From d80c6de85399f9b747b5b29c88f2a7c88fa8d744 Mon Sep 17 00:00:00 2001 From: l1npengtul Date: Thu, 8 Jan 2026 23:03:31 +0900 Subject: [PATCH 1/2] socalabs-papu: init at 1.2.0 --- pkgs/by-name/so/socalabs-papu/package.nix | 153 ++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 pkgs/by-name/so/socalabs-papu/package.nix diff --git a/pkgs/by-name/so/socalabs-papu/package.nix b/pkgs/by-name/so/socalabs-papu/package.nix new file mode 100644 index 000000000000..3aeb53c6a08d --- /dev/null +++ b/pkgs/by-name/so/socalabs-papu/package.nix @@ -0,0 +1,153 @@ +{ + stdenv, + fetchFromGitHub, + lib, + cmake, + pkg-config, + alsa-lib, + copyDesktopItems, + makeDesktopItem, + libX11, + libXcomposite, + libXcursor, + libXinerama, + libXrandr, + libXtst, + libXdmcp, + libXext, + xvfb, + freetype, + fontconfig, + expat, + libGL, + libjack2, + curl, + ninja, + writableTmpDirAsHomeHook, + nix-update-script, + # Disable VST building by default, since NixOS doesn't have a VST license + enableVST2 ? false, +}: +let + version = "1.2.0"; +in +stdenv.mkDerivation { + pname = "socalabs-papu"; + inherit version; + + src = fetchFromGitHub { + owner = "FigBug"; + repo = "PAPU"; + tag = "v${version}"; + hash = "sha256-psSwQJwfCvsSgF72/K0WZQRqt0CoasVITLH69V4XcUg="; + fetchSubmodules = true; + preFetch = '' + # can't clone using ssh + export GIT_CONFIG_COUNT=1 + export GIT_CONFIG_KEY_0=url.https://github.com/.insteadOf + export GIT_CONFIG_VALUE_0=git@github.com: + ''; + }; + + desktopItems = [ + (makeDesktopItem { + type = "Application"; + name = "socalabs-papu"; + desktopName = "Socalabs PAPU"; + comment = "Socalabs Nintendo Gameboy PAPU Emulation Plugin (Standalone)"; + icon = "PAPU"; + exec = "PAPU"; + categories = [ + "Audio" + "AudioVideo" + ]; + }) + ]; + + nativeBuildInputs = [ + writableTmpDirAsHomeHook + cmake + pkg-config + copyDesktopItems + ninja + ]; + + buildInputs = [ + alsa-lib + libX11 + libXcomposite + libXcursor + libXinerama + libXrandr + libXtst + libXdmcp + libXext + xvfb + libGL + libjack2 + freetype + fontconfig + expat + curl + ]; + + cmakeFlags = [ + (lib.cmakeBool "JUCE_COPY_PLUGIN_AFTER_BUILD" false) + "--preset ninja-gcc" + ]; + + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail 'FORMATS Standalone VST VST3 AU LV2' 'FORMATS Standalone ${lib.optionalString enableVST2 "VST"} VST3 LV2' + ''; + + strictDeps = true; + + preBuild = '' + cd ../Builds/ninja-gcc + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/lib/vst3 $out/lib/lv2 $out/bin + + ${lib.optionalString enableVST2 '' + mkdir -p $out/lib/vst + cp -r PAPU_artefacts/Release/VST/libPAPU.so $out/lib/vst + ''} + + cp -r PAPU_artefacts/Release/LV2/PAPU.lv2 $out/lib/lv2 + cp -r PAPU_artefacts/Release/VST3/PAPU.vst3 $out/lib/vst3 + + install -Dm755 PAPU_artefacts/Release/Standalone/PAPU $out/bin + + install -Dm444 $src/plugin/Resources/icon.png $out/share/pixmaps/PAPU.png + + runHook postInstall + ''; + + passthru.updateScript = nix-update-script { }; + + NIX_LDFLAGS = ( + toString [ + "-lX11" + "-lXext" + "-lXcomposite" + "-lXcursor" + "-lXinerama" + "-lXrandr" + "-lXtst" + "-lXdmcp" + ] + ); + + meta = { + description = "Socalabs Nintendo Gameboy PAPU Emulation Plugin"; + homepage = "https://socalabs.com/synths/papu/"; + mainProgram = "PAPU"; + platforms = lib.platforms.linux; + license = [ lib.licenses.gpl2 ] ++ lib.optional enableVST2 lib.licenses.unfree; + maintainers = [ lib.maintainers.l1npengtul ]; + }; +} From 1cd83581ef8d85dd4e29cca4dcff808bf5c1f075 Mon Sep 17 00:00:00 2001 From: l1npengtul Date: Fri, 9 Jan 2026 06:34:47 +0900 Subject: [PATCH 2/2] socalabs-papu: init at 1.2.0 --- pkgs/by-name/so/socalabs-papu/package.nix | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/pkgs/by-name/so/socalabs-papu/package.nix b/pkgs/by-name/so/socalabs-papu/package.nix index 3aeb53c6a08d..8b4b06b2f221 100644 --- a/pkgs/by-name/so/socalabs-papu/package.nix +++ b/pkgs/by-name/so/socalabs-papu/package.nix @@ -25,28 +25,19 @@ ninja, writableTmpDirAsHomeHook, nix-update-script, - # Disable VST building by default, since NixOS doesn't have a VST license + # Disable VST building by default, since its unfree enableVST2 ? false, }: -let - version = "1.2.0"; -in -stdenv.mkDerivation { +stdenv.mkDerivation (finalAttrs: { pname = "socalabs-papu"; - inherit version; + version = "1.2.0"; src = fetchFromGitHub { owner = "FigBug"; repo = "PAPU"; - tag = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-psSwQJwfCvsSgF72/K0WZQRqt0CoasVITLH69V4XcUg="; fetchSubmodules = true; - preFetch = '' - # can't clone using ssh - export GIT_CONFIG_COUNT=1 - export GIT_CONFIG_KEY_0=url.https://github.com/.insteadOf - export GIT_CONFIG_VALUE_0=git@github.com: - ''; }; desktopItems = [ @@ -120,7 +111,7 @@ stdenv.mkDerivation { cp -r PAPU_artefacts/Release/LV2/PAPU.lv2 $out/lib/lv2 cp -r PAPU_artefacts/Release/VST3/PAPU.vst3 $out/lib/vst3 - install -Dm755 PAPU_artefacts/Release/Standalone/PAPU $out/bin + install -Dm555 PAPU_artefacts/Release/Standalone/PAPU $out/bin install -Dm444 $src/plugin/Resources/icon.png $out/share/pixmaps/PAPU.png @@ -150,4 +141,4 @@ stdenv.mkDerivation { license = [ lib.licenses.gpl2 ] ++ lib.optional enableVST2 lib.licenses.unfree; maintainers = [ lib.maintainers.l1npengtul ]; }; -} +})