From 2cedaac1cb9f30827ddbd1718221537269eaf51f Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Fri, 19 Mar 2021 14:02:04 +0100 Subject: [PATCH 1/5] xa: add fallback download url, fix substitution, enable tests --- pkgs/development/compilers/xa/xa.nix | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/xa/xa.nix b/pkgs/development/compilers/xa/xa.nix index c445940f5cde..dbeabe97b1aa 100644 --- a/pkgs/development/compilers/xa/xa.nix +++ b/pkgs/development/compilers/xa/xa.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchurl +, perl }: stdenv.mkDerivation rec { @@ -8,22 +9,39 @@ stdenv.mkDerivation rec { version = "2.3.11"; src = fetchurl { - url = "https://www.floodgap.com/retrotech/xa/dists/${pname}-${version}.tar.gz"; + urls = [ + "https://www.floodgap.com/retrotech/xa/dists/${pname}-${version}.tar.gz" + "https://www.floodgap.com/retrotech/xa/dists/unsupported/${pname}-${version}.tar.gz" + ]; hash = "sha256-MvIWTJnjBSGOmSlwhW3Y4jCbXLasR1jXsq/jv+vJAS0="; }; + checkInputs = [ perl ]; + dontConfigure = true; postPatch = '' substituteInPlace Makefile \ - --replace "DESTDIR" "PREFIX" \ --replace "CC = gcc" "CC = ${stdenv.cc.targetPrefix}cc" \ - --replace "LDD = gcc" "LDD = ${stdenv.cc.targetPrefix}cc" \ + --replace "LD = gcc" "LD = ${stdenv.cc.targetPrefix}cc" \ --replace "CFLAGS = -O2" "CFLAGS ?=" \ --replace "LDFLAGS = -lc" "LDFLAGS ?= -lc" ''; - makeFlags = [ "PREFIX=${placeholder "out"}" ]; + makeFlags = [ + "DESTDIR:=${placeholder "out"}" + ]; + + enableParallelBuilding = true; + + doCheck = true; + + # Running tests in parallel does not work + enableParallelChecking = false; + + preCheck = '' + patchShebangs tests + ''; meta = with lib; { homepage = "https://www.floodgap.com/retrotech/xa/"; From f6519a5191e56ec7ff16e1218493503e735074e1 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Fri, 19 Mar 2021 14:02:07 +0100 Subject: [PATCH 2/5] dxa: add fallback download url --- pkgs/development/compilers/xa/dxa.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/xa/dxa.nix b/pkgs/development/compilers/xa/dxa.nix index 03f2d054cc80..56661c1dbcc9 100644 --- a/pkgs/development/compilers/xa/dxa.nix +++ b/pkgs/development/compilers/xa/dxa.nix @@ -9,7 +9,10 @@ stdenv.mkDerivation rec { version = "0.1.4"; src = fetchurl { - url = "https://www.floodgap.com/retrotech/xa/dists/${pname}-${version}.tar.gz"; + urls = [ + "https://www.floodgap.com/retrotech/xa/dists/${pname}-${version}.tar.gz" + "https://www.floodgap.com/retrotech/xa/dists/unsupported/${pname}-${version}.tar.gz" + ]; hash = "sha256-C0rgwK51Ij9EZCm9GeiVnWIkEkse0d60ok8G9hm2a5U="; }; From 9ee7244c60bc344ce0ab60e27cd749c997c5d84c Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Fri, 19 Mar 2021 14:02:09 +0100 Subject: [PATCH 3/5] libexsid: init at 2.1 --- .../libraries/libexsid/default.nix | 47 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 49 insertions(+) create mode 100644 pkgs/development/libraries/libexsid/default.nix diff --git a/pkgs/development/libraries/libexsid/default.nix b/pkgs/development/libraries/libexsid/default.nix new file mode 100644 index 000000000000..38cdfc84d4e4 --- /dev/null +++ b/pkgs/development/libraries/libexsid/default.nix @@ -0,0 +1,47 @@ +{ stdenv +, lib +, fetchFromGitHub +, autoreconfHook +, pkg-config +, docSupport ? true +, doxygen +, libftdi1 +}: + +stdenv.mkDerivation rec { + pname = "libexsid"; + version = "2.1"; + + src = fetchFromGitHub { + owner = "libsidplayfp"; + repo = "exsid-driver"; + rev = version; + sha256 = "1qbiri549fma8c72nmj3cpz3sn1vc256kfafnygkmkzg7wdmgi7r"; + }; + + outputs = [ "out" ] + ++ lib.optional docSupport "doc"; + + nativeBuildInputs = [ autoreconfHook pkg-config ] + ++ lib.optional docSupport doxygen; + + buildInputs = [ libftdi1 ]; + + enableParallelBuilding = true; + + installTargets = [ "install" ] + ++ lib.optional docSupport "doc"; + + postInstall = lib.optionalString docSupport '' + mkdir -p $doc/share/libexsid/doc + cp -r docs/html $doc/share/libexsid/doc/ + ''; + + meta = with lib; { + description = "Driver for exSID USB"; + homepage = "http://hacks.slashdirt.org/hw/exsid/"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ OPNA2608 ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 10a4c799ebef..d4fbbe3c178b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15505,6 +15505,8 @@ in libexosip = callPackage ../development/libraries/exosip {}; + libexsid = callPackage ../development/libraries/libexsid { }; + libextractor = callPackage ../development/libraries/libextractor { libmpeg2 = mpeg2dec; }; From 29072962edecfc64d971e99fe82474b64031ae1e Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Fri, 19 Mar 2021 14:02:10 +0100 Subject: [PATCH 4/5] libsidplayfp: 2.0.5 -> 2.1.1 --- .../libraries/libsidplayfp/default.nix | 83 ++++++++++++++----- 1 file changed, 63 insertions(+), 20 deletions(-) diff --git a/pkgs/development/libraries/libsidplayfp/default.nix b/pkgs/development/libraries/libsidplayfp/default.nix index d5f8dd6e5730..97991a0cffbf 100644 --- a/pkgs/development/libraries/libsidplayfp/default.nix +++ b/pkgs/development/libraries/libsidplayfp/default.nix @@ -1,45 +1,88 @@ { stdenv , lib -, fetchurl +, fetchFromGitHub +, fetchpatch +, autoreconfHook , pkg-config +, perl +, unittest-cpp +, xa +, libgcrypt +, libexsid , docSupport ? true -, doxygen ? null -, graphviz ? null +, doxygen +, graphviz }: -assert docSupport -> doxygen != null && graphviz != null; -let - inherit (lib) optionals optionalString; - inherit (lib.versions) majorMinor; -in stdenv.mkDerivation rec { pname = "libsidplayfp"; - version = "2.0.5"; + version = "2.1.1"; - src = fetchurl { - url = "mirror://sourceforge/sidplay-residfp/${pname}/${majorMinor version}/${pname}-${version}.tar.gz"; - sha256 = "04vdrrkh5y9x9rrmj6gdp242ah70b4sslwqfby8wp2riis4hr9z0"; + src = fetchFromGitHub { + owner = "libsidplayfp"; + repo = "libsidplayfp"; + rev = "v${version}"; + fetchSubmodules = true; + sha256 = "0487gap2b0ypikyra74lk1qwqwr0vncldamk5xb1db2x97v504fd"; }; - nativeBuildInputs = [ pkg-config ] - ++ optionals docSupport [ doxygen graphviz ]; + # https://github.com/libsidplayfp/libsidplayfp/issues/13 + # Remove on next version bump + patches = [ + (fetchpatch { + url = "https://github.com/libsidplayfp/libsidplayfp/commit/84f5498f5653261ed84328e1b5676c31e3ba9e6e.patch"; + sha256 = "1vysbl4fkdzm11k40msng2ag6i6mb6z9jsw32vyj9calcfha5957"; + }) + (fetchpatch { + url = "https://github.com/libsidplayfp/libsidplayfp/commit/c1a1b732cc2e791d910522d58f47c6d094493c6d.patch"; + sha256 = "1d3sgdly0q9dysgkx5afxbwfas6p0m8n3lw1hmj4n6wm3j9sdz4g"; + }) + ]; + + postPatch = '' + patchShebangs . + ''; + + nativeBuildInputs = [ autoreconfHook pkg-config perl xa ] + ++ lib.optionals docSupport [ doxygen graphviz ]; + + buildInputs = [ libgcrypt libexsid ]; + + doCheck = true; + + checkInputs = [ unittest-cpp ]; + + enableParallelBuilding = true; installTargets = [ "install" ] - ++ optionals docSupport [ "doc" ]; + ++ lib.optionals docSupport [ "doc" ]; outputs = [ "out" ] - ++ optionals docSupport [ "doc" ]; + ++ lib.optionals docSupport [ "doc" ]; - postInstall = optionalString docSupport '' + configureFlags = [ + "--enable-hardsid" + "--with-gcrypt" + "--with-exsid" + ] + ++ lib.optional doCheck "--enable-tests"; + + postInstall = lib.optionalString docSupport '' mkdir -p $doc/share/doc/libsidplayfp mv docs/html $doc/share/doc/libsidplayfp/ ''; meta = with lib; { description = "A library to play Commodore 64 music derived from libsidplay2"; - homepage = "https://sourceforge.net/projects/sidplay-residfp/"; + longDescription = '' + libsidplayfp is a C64 music player library which integrates + the reSID SID chip emulation into a cycle-based emulator + environment, constantly aiming to improve emulation of the + C64 system and the SID chips. + ''; + homepage = "https://github.com/libsidplayfp/libsidplayfp"; license = with licenses; [ gpl2Plus ]; - maintainers = with maintainers; [ ramkromberg ]; - platforms = with platforms; unix; + maintainers = with maintainers; [ ramkromberg OPNA2608 ]; + platforms = platforms.all; }; } From b85a2687bf58f7e64abfdec3a373dffdbfc6d9fa Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sun, 28 Mar 2021 14:24:39 +0200 Subject: [PATCH 5/5] sidplayfp: 2.0.2 -> 2.1.1 --- pkgs/applications/audio/sidplayfp/default.nix | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/pkgs/applications/audio/sidplayfp/default.nix b/pkgs/applications/audio/sidplayfp/default.nix index cebf0d83e16b..65f21c136121 100644 --- a/pkgs/applications/audio/sidplayfp/default.nix +++ b/pkgs/applications/audio/sidplayfp/default.nix @@ -1,40 +1,47 @@ { stdenv , lib -, fetchurl +, fetchFromGitHub +, autoreconfHook +, perl , pkg-config , libsidplayfp , alsaSupport ? stdenv.hostPlatform.isLinux , alsaLib , pulseSupport ? stdenv.hostPlatform.isLinux , libpulseaudio +, out123Support ? stdenv.hostPlatform.isDarwin +, mpg123 }: -assert alsaSupport -> alsaLib != null; -assert pulseSupport -> libpulseaudio != null; -let - inherit (lib) optional; - inherit (lib.versions) majorMinor; -in stdenv.mkDerivation rec { pname = "sidplayfp"; - version = "2.0.2"; + version = "2.1.1"; - src = fetchurl { - url = "mirror://sourceforge/sidplay-residfp/sidplayfp/${majorMinor version}/${pname}-${version}.tar.gz"; - sha256 = "1s2dfs9z1hwarpfzawg11wax9nh0zcqx4cafwq7iysckyg4scz4k"; + src = fetchFromGitHub { + owner = "libsidplayfp"; + repo = "sidplayfp"; + rev = "v${version}"; + sha256 = "0s3xmg3yzfqbsnlh2y46w7b5jim5zq7mshs6hx03q8wdr75cvwh4"; }; - nativeBuildInputs = [ pkg-config ] - ++ optional alsaSupport alsaLib - ++ optional pulseSupport libpulseaudio; + nativeBuildInputs = [ autoreconfHook perl pkg-config ]; - buildInputs = [ libsidplayfp ]; + buildInputs = [ libsidplayfp ] + ++ lib.optional alsaSupport alsaLib + ++ lib.optional pulseSupport libpulseaudio + ++ lib.optional out123Support mpg123; + + configureFlags = lib.optionals out123Support [ + "--with-out123" + ]; + + enableParallelBuilding = true; meta = with lib; { description = "A SID player using libsidplayfp"; - homepage = "https://sourceforge.net/projects/sidplay-residfp/"; + homepage = "https://github.com/libsidplayfp/sidplayfp"; license = with licenses; [ gpl2Plus ]; - maintainers = with maintainers; [ dezgeg ]; - platforms = with platforms; linux; + maintainers = with maintainers; [ dezgeg OPNA2608 ]; + platforms = platforms.all; }; }