From f6d7348cee28cad7ddafe683b16c73a3cc7de52a Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 21 Dec 2021 12:08:34 +0100 Subject: [PATCH] ecl: refactor --- pkgs/development/compilers/ecl/16.1.2.nix | 66 ++++++++++--------- pkgs/development/compilers/ecl/default.nix | 60 +++++++++-------- .../compilers/ecl/default.upstream | 2 - 3 files changed, 70 insertions(+), 58 deletions(-) delete mode 100644 pkgs/development/compilers/ecl/default.upstream diff --git a/pkgs/development/compilers/ecl/16.1.2.nix b/pkgs/development/compilers/ecl/16.1.2.nix index 2742c2b8c07e..9af1eccc7935 100644 --- a/pkgs/development/compilers/ecl/16.1.2.nix +++ b/pkgs/development/compilers/ecl/16.1.2.nix @@ -1,38 +1,45 @@ -{ lib, stdenv, fetchurl, fetchpatch -, libtool, autoconf, automake -, gmp, mpfr, libffi, makeWrapper +{ lib +, stdenv +, fetchurl +, fetchpatch +, libtool +, autoconf +, automake +, gmp +, mpfr +, libffi +, makeWrapper , noUnicode ? false , gcc , threadSupport ? false -, useBoehmgc ? true, boehmgc +, useBoehmgc ? true +, boehmgc }: -let - s = # Generated upstream information - rec { - baseName="ecl"; - version="16.1.2"; - name="${baseName}-${version}"; - url="https://common-lisp.net/project/ecl/static/files/release/ecl-${version}.tgz"; - sha256="16ab8qs3awvdxy8xs8jy82v8r04x4wr70l9l2j45vgag18d2nj1d"; +stdenv.mkDerivation rec { + pname = "ecl"; + version = "16.1.2"; + + src = fetchurl { + url = "https://common-lisp.net/project/ecl/static/files/release/ecl-${version}.tgz"; + sha256 = "sha256-LUgrGgpPvV2IFDRRcDInnYCMtkBeIt2R721zNTRGS5k="; }; + buildInputs = [ - libtool autoconf automake makeWrapper + libtool + autoconf + automake + makeWrapper ]; propagatedBuildInputs = [ - libffi gmp mpfr gcc + libffi + gmp + mpfr + gcc ] ++ lib.optionals useBoehmgc [ # replaces ecl's own gc which other packages can depend on, thus propagated boehmgc ]; -in -stdenv.mkDerivation { - inherit (s) name version; - inherit buildInputs propagatedBuildInputs; - - src = fetchurl { - inherit (s) url sha256; - }; configureFlags = [ (if threadSupport then "--enable-threads" else "--disable-threads") @@ -40,8 +47,8 @@ stdenv.mkDerivation { "--with-gmp-libdir=${lib.getLib gmp}/lib" # -incdir, -libdir doesn't seem to be supported for libffi "--with-libffi-prefix=${lib.getDev libffi}" - ] ++ lib.optional (! noUnicode) "--enable-unicode" - ; + ] ++ lib.optional (! noUnicode) "--enable-unicode" + ; patches = [ (fetchpatch { @@ -80,17 +87,16 @@ stdenv.mkDerivation { # create the variables with suffixSalt (which seems to be necessary for # NIX_CFLAGS_COMPILE even). + lib.optionalString useBoehmgc '' - --prefix NIX_CFLAGS_COMPILE_${gcc.suffixSalt} ' ' "-I${lib.getDev boehmgc}/include" \ - --prefix NIX_LDFLAGS_BEFORE_${gcc.bintools.suffixSalt} ' ' "-L${lib.getLib boehmgc}/lib" \ + --prefix NIX_CFLAGS_COMPILE_${gcc.suffixSalt} ' ' "-I${lib.getDev boehmgc}/include" \ + --prefix NIX_LDFLAGS_BEFORE_${gcc.bintools.suffixSalt} ' ' "-L${lib.getLib boehmgc}/lib" \ '' + '' - --prefix NIX_LDFLAGS_BEFORE_${gcc.bintools.suffixSalt} ' ' "-L${lib.getLib libffi}/lib" + --prefix NIX_LDFLAGS_BEFORE_${gcc.bintools.suffixSalt} ' ' "-L${lib.getLib libffi}/lib" ''; meta = with lib; { - inherit (s) version; description = "Lisp implementation aiming to be small, fast and easy to embed"; - license = licenses.mit ; - maintainers = [ maintainers.raskin ]; + license = licenses.mit; + maintainers = with maintainers; [ raskin ]; platforms = platforms.unix; }; } diff --git a/pkgs/development/compilers/ecl/default.nix b/pkgs/development/compilers/ecl/default.nix index 9d2ded48a377..c442364d198e 100644 --- a/pkgs/development/compilers/ecl/default.nix +++ b/pkgs/development/compilers/ecl/default.nix @@ -1,40 +1,48 @@ -{lib, stdenv, fetchurl, fetchpatch -, libtool, autoconf, automake +{ lib +, stdenv +, fetchurl +, fetchpatch +, libtool +, autoconf +, automake , texinfo -, gmp, mpfr, libffi, makeWrapper +, gmp +, mpfr +, libffi +, makeWrapper , noUnicode ? false , gcc , threadSupport ? true -, useBoehmgc ? false, boehmgc +, useBoehmgc ? false +, boehmgc }: -let - s = # Generated upstream information - rec { - baseName="ecl"; - version="21.2.1"; - name="${baseName}-${version}"; - url="https://common-lisp.net/project/ecl/static/files/release/${name}.tgz"; - sha256="000906nnq25177bgsfndiw3iqqgrjc9spk10hzk653sbz3f7anmi"; + +stdenv.mkDerivation rec { + pname = "ecl"; + version = "21.2.1"; + + src = fetchurl { + url = "https://common-lisp.net/project/ecl/static/files/release/ecl-${version}.tgz"; + sha256 = "sha256-sVp13PhLj2LmhyDMqxOT+WEcB4/NOv3WOaEIbK0BCQA="; }; + nativeBuildInputs = [ - libtool autoconf automake texinfo makeWrapper + libtool + autoconf + automake + texinfo + makeWrapper ]; propagatedBuildInputs = [ - libffi gmp mpfr gcc + libffi + gmp + mpfr + gcc # replaces ecl's own gc which other packages can depend on, thus propagated ] ++ lib.optionals useBoehmgc [ # replaces ecl's own gc which other packages can depend on, thus propagated boehmgc ]; -in -stdenv.mkDerivation { - inherit (s) version; - pname = s.baseName; - inherit nativeBuildInputs propagatedBuildInputs; - - src = fetchurl { - inherit (s) url sha256; - }; patches = [ # https://gitlab.com/embeddable-common-lisp/ecl/-/merge_requests/1 @@ -70,9 +78,9 @@ stdenv.mkDerivation { meta = with lib; { description = "Lisp implementation aiming to be small, fast and easy to embed"; homepage = "https://common-lisp.net/project/ecl/"; - license = licenses.mit ; - maintainers = [ maintainers.raskin ]; + license = licenses.mit; + maintainers = with maintainers; [ raskin ]; platforms = platforms.unix; - changelog = "https://gitlab.com/embeddable-common-lisp/ecl/-/raw/${s.version}/CHANGELOG"; + changelog = "https://gitlab.com/embeddable-common-lisp/ecl/-/raw/${version}/CHANGELOG"; }; } diff --git a/pkgs/development/compilers/ecl/default.upstream b/pkgs/development/compilers/ecl/default.upstream deleted file mode 100644 index eeb82cbfcab1..000000000000 --- a/pkgs/development/compilers/ecl/default.upstream +++ /dev/null @@ -1,2 +0,0 @@ -url https://common-lisp.net/project/ecl/ -version_link '[.]tgz$'