ecl: refactor

This commit is contained in:
Felix Buehler 2021-12-21 12:08:34 +01:00
parent 459f9fe2be
commit f6d7348cee
3 changed files with 70 additions and 58 deletions

View file

@ -1,38 +1,45 @@
{ lib, stdenv, fetchurl, fetchpatch { lib
, libtool, autoconf, automake , stdenv
, gmp, mpfr, libffi, makeWrapper , fetchurl
, fetchpatch
, libtool
, autoconf
, automake
, gmp
, mpfr
, libffi
, makeWrapper
, noUnicode ? false , noUnicode ? false
, gcc , gcc
, threadSupport ? false , threadSupport ? false
, useBoehmgc ? true, boehmgc , useBoehmgc ? true
, boehmgc
}: }:
let stdenv.mkDerivation rec {
s = # Generated upstream information pname = "ecl";
rec { version = "16.1.2";
baseName="ecl";
version="16.1.2"; src = fetchurl {
name="${baseName}-${version}"; url = "https://common-lisp.net/project/ecl/static/files/release/ecl-${version}.tgz";
url="https://common-lisp.net/project/ecl/static/files/release/ecl-${version}.tgz"; sha256 = "sha256-LUgrGgpPvV2IFDRRcDInnYCMtkBeIt2R721zNTRGS5k=";
sha256="16ab8qs3awvdxy8xs8jy82v8r04x4wr70l9l2j45vgag18d2nj1d";
}; };
buildInputs = [ buildInputs = [
libtool autoconf automake makeWrapper libtool
autoconf
automake
makeWrapper
]; ];
propagatedBuildInputs = [ propagatedBuildInputs = [
libffi gmp mpfr gcc libffi
gmp
mpfr
gcc
] ++ lib.optionals useBoehmgc [ ] ++ lib.optionals useBoehmgc [
# replaces ecl's own gc which other packages can depend on, thus propagated # replaces ecl's own gc which other packages can depend on, thus propagated
boehmgc boehmgc
]; ];
in
stdenv.mkDerivation {
inherit (s) name version;
inherit buildInputs propagatedBuildInputs;
src = fetchurl {
inherit (s) url sha256;
};
configureFlags = [ configureFlags = [
(if threadSupport then "--enable-threads" else "--disable-threads") (if threadSupport then "--enable-threads" else "--disable-threads")
@ -40,8 +47,8 @@ stdenv.mkDerivation {
"--with-gmp-libdir=${lib.getLib gmp}/lib" "--with-gmp-libdir=${lib.getLib gmp}/lib"
# -incdir, -libdir doesn't seem to be supported for libffi # -incdir, -libdir doesn't seem to be supported for libffi
"--with-libffi-prefix=${lib.getDev libffi}" "--with-libffi-prefix=${lib.getDev libffi}"
] ++ lib.optional (! noUnicode) "--enable-unicode" ] ++ lib.optional (! noUnicode) "--enable-unicode"
; ;
patches = [ patches = [
(fetchpatch { (fetchpatch {
@ -80,17 +87,16 @@ stdenv.mkDerivation {
# create the variables with suffixSalt (which seems to be necessary for # create the variables with suffixSalt (which seems to be necessary for
# NIX_CFLAGS_COMPILE even). # NIX_CFLAGS_COMPILE even).
+ lib.optionalString useBoehmgc '' + lib.optionalString useBoehmgc ''
--prefix NIX_CFLAGS_COMPILE_${gcc.suffixSalt} ' ' "-I${lib.getDev boehmgc}/include" \ --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 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; { meta = with lib; {
inherit (s) version;
description = "Lisp implementation aiming to be small, fast and easy to embed"; description = "Lisp implementation aiming to be small, fast and easy to embed";
license = licenses.mit ; license = licenses.mit;
maintainers = [ maintainers.raskin ]; maintainers = with maintainers; [ raskin ];
platforms = platforms.unix; platforms = platforms.unix;
}; };
} }

View file

@ -1,40 +1,48 @@
{lib, stdenv, fetchurl, fetchpatch { lib
, libtool, autoconf, automake , stdenv
, fetchurl
, fetchpatch
, libtool
, autoconf
, automake
, texinfo , texinfo
, gmp, mpfr, libffi, makeWrapper , gmp
, mpfr
, libffi
, makeWrapper
, noUnicode ? false , noUnicode ? false
, gcc , gcc
, threadSupport ? true , threadSupport ? true
, useBoehmgc ? false, boehmgc , useBoehmgc ? false
, boehmgc
}: }:
let
s = # Generated upstream information stdenv.mkDerivation rec {
rec { pname = "ecl";
baseName="ecl"; version = "21.2.1";
version="21.2.1";
name="${baseName}-${version}"; src = fetchurl {
url="https://common-lisp.net/project/ecl/static/files/release/${name}.tgz"; url = "https://common-lisp.net/project/ecl/static/files/release/ecl-${version}.tgz";
sha256="000906nnq25177bgsfndiw3iqqgrjc9spk10hzk653sbz3f7anmi"; sha256 = "sha256-sVp13PhLj2LmhyDMqxOT+WEcB4/NOv3WOaEIbK0BCQA=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
libtool autoconf automake texinfo makeWrapper libtool
autoconf
automake
texinfo
makeWrapper
]; ];
propagatedBuildInputs = [ propagatedBuildInputs = [
libffi gmp mpfr gcc libffi
gmp
mpfr
gcc
# replaces ecl's own gc which other packages can depend on, thus propagated # replaces ecl's own gc which other packages can depend on, thus propagated
] ++ lib.optionals useBoehmgc [ ] ++ lib.optionals useBoehmgc [
# replaces ecl's own gc which other packages can depend on, thus propagated # replaces ecl's own gc which other packages can depend on, thus propagated
boehmgc boehmgc
]; ];
in
stdenv.mkDerivation {
inherit (s) version;
pname = s.baseName;
inherit nativeBuildInputs propagatedBuildInputs;
src = fetchurl {
inherit (s) url sha256;
};
patches = [ patches = [
# https://gitlab.com/embeddable-common-lisp/ecl/-/merge_requests/1 # https://gitlab.com/embeddable-common-lisp/ecl/-/merge_requests/1
@ -70,9 +78,9 @@ stdenv.mkDerivation {
meta = with lib; { meta = with lib; {
description = "Lisp implementation aiming to be small, fast and easy to embed"; description = "Lisp implementation aiming to be small, fast and easy to embed";
homepage = "https://common-lisp.net/project/ecl/"; homepage = "https://common-lisp.net/project/ecl/";
license = licenses.mit ; license = licenses.mit;
maintainers = [ maintainers.raskin ]; maintainers = with maintainers; [ raskin ];
platforms = platforms.unix; 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";
}; };
} }

View file

@ -1,2 +0,0 @@
url https://common-lisp.net/project/ecl/
version_link '[.]tgz$'