ats2: fix darwin build; move to by-name (#353745)

This commit is contained in:
Weijia Wang 2024-11-06 00:34:12 +01:00 committed by GitHub
commit e88003696a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 21 additions and 14 deletions

View File

@ -1,6 +1,11 @@
{ lib, stdenv, fetchurl, gmp
, withEmacsSupport ? true
, withContrib ? true }:
{
lib,
stdenv,
fetchurl,
gmp,
withEmacsSupport ? true,
withContrib ? true,
}:
let
versionPkg = "0.4.2";
@ -10,15 +15,13 @@ let
hash = "sha256-m0hfBLsaNiLaIktcioK+ZtWUsWht3IDSJ6CzgJmS06c=";
};
postInstallContrib = lib.optionalString withContrib
''
postInstallContrib = lib.optionalString withContrib ''
local contribDir=$out/lib/ats2-postiats-*/ ;
mkdir -p $contribDir ;
tar -xzf "${contrib}" --strip-components 1 -C $contribDir ;
'';
postInstallEmacs = lib.optionalString withEmacsSupport
''
postInstallEmacs = lib.optionalString withEmacsSupport ''
local siteLispDir=$out/share/emacs/site-lisp/ats2 ;
mkdir -p $siteLispDir ;
install -m 0644 -v ./utils/emacs/*.el $siteLispDir ;
@ -49,20 +52,25 @@ stdenv.mkDerivation rec {
"CCOMP=${stdenv.cc.targetPrefix}cc"
];
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=implicit-function-declaration";
setupHook =
let
hookFiles = [ ./setup-hook.sh ] ++ lib.optional withContrib ./setup-contrib-hook.sh;
in
builtins.toFile "setupHook.sh"
(lib.concatMapStringsSep "\n" builtins.readFile hookFiles);
builtins.toFile "setupHook.sh" (lib.concatMapStringsSep "\n" builtins.readFile hookFiles);
postInstall = postInstallContrib + postInstallEmacs;
meta = with lib; {
description = "Functional programming language with dependent types";
homepage = "http://www.ats-lang.org";
license = licenses.gpl3Plus;
platforms = platforms.unix;
maintainers = with maintainers; [ thoughtpolice ttuegel bbarker ];
homepage = "http://www.ats-lang.org";
license = licenses.gpl3Plus;
platforms = platforms.unix;
maintainers = with maintainers; [
thoughtpolice
ttuegel
bbarker
];
};
}

View File

@ -14166,7 +14166,6 @@ with pkgs;
aspectj = callPackage ../development/compilers/aspectj { };
ats = callPackage ../development/compilers/ats { };
ats2 = callPackage ../development/compilers/ats2 { };
ats-acc = callPackage ../development/tools/ats-acc { };