Unverified Commit a8ada7ce authored by Yohann Boniface's avatar Yohann Boniface Committed by GitHub
Browse files

alan_2: unbreak on gcc 14, modernize; alan: modernize (#400242)

parents 70b191e2 f5d30316
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -8,15 +8,15 @@
  which,
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "alan";
  version = "3.0beta8";

  src = fetchFromGitHub {
    owner = "alan-if";
    repo = "alan";
    rev = "v${version}";
    sha256 = "0zfg1frmb4yl39hk8h733bmlwk4rkikzfhvv7j34cxpdpsp7spzl";
    rev = "v${finalAttrs.version}";
    sha256 = "sha256-9F99rr7tdkaGPHtD92ecmUxO6xrjQDRhGtSTVbMLz30=";
  };

  postPatch = ''
@@ -27,6 +27,8 @@ stdenv.mkDerivation rec {
  '';

  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin $out/share/alan/examples
    # Build the release tarball
    make package
@@ -37,6 +39,8 @@ stdenv.mkDerivation rec {
    mv $out/share/alan/{alan,arun} $out/bin
    # a2a3 isn't included in the release tarball
    cp bin/a2a3 $out/bin

    runHook postInstall
  '';

  nativeBuildInputs = [
@@ -46,11 +50,11 @@ stdenv.mkDerivation rec {
    which
  ];

  meta = with lib; {
  meta = {
    homepage = "https://www.alanif.se/";
    description = "Alan interactive fiction language";
    license = licenses.artistic2;
    platforms = platforms.linux;
    maintainers = with maintainers; [ neilmayhew ];
    license = lib.licenses.artistic2;
    platforms = lib.platforms.linux;
    maintainers = with lib.maintainers; [ neilmayhew ];
  };
}
})
+48 −0
Original line number Diff line number Diff line
@@ -12,27 +12,37 @@ stdenv.mkDerivation {
    owner = "alan-if";
    repo = "alan";
    rev = "71f23ec79f7f5d66aa5ae9fd3f9b8dae41a89f15";
    sha256 = "066jknqz1v6sismvfxjfffl35h14v8qwgcq99ibhp08dy2fwraln";
    hash = "sha256-lqrMnfANgQtXTAmzxzHaJMAyqHNOdrerjtrs8LGd0hg=";
  };

  makefile = "Makefile.unix";

  # Add a workarounf for -fno-common tollchains like upstream gcc-10.
  env.NIX_CFLAGS_COMPILE = toString [
    # Add a workaround for -fno-common toolchains like upstream gcc-10.
    # alan-3 is already fixed, but the backport is nontrivial.
  env.NIX_CFLAGS_COMPILE = "-fcommon";
    "-fcommon"
    # smScSema.c:142:11: error: assignment to 'unsigned char *' from incompatible pointer type 'unsigned char **' [-Wincompatible-pointer-types]
    "-Wno-error=incompatible-pointer-types"
    # smScSema.c:183:10: error: implicit declaration of function 'read'; did you mean 'fread'? [-Wimplicit-function-declaration]
    "-Wno-error=implicit-function-declaration"
  ];

  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin $out/share/alan2
    cp compiler/alan $out/bin/alan2
    cp interpreter/arun $out/bin/arun2
    cp alan.readme ChangeLog $out/share/alan2

    runHook postInstall
  '';

  meta = with lib; {
  meta = {
    homepage = "https://www.alanif.se/";
    description = "Alan interactive fiction language (legacy version)";
    license = licenses.artistic2;
    platforms = platforms.linux;
    maintainers = with maintainers; [ neilmayhew ];
    license = lib.licenses.artistic2;
    platforms = lib.platforms.linux;
    maintainers = with lib.maintainers; [ neilmayhew ];
  };
}
+0 −4
Original line number Diff line number Diff line
@@ -5721,10 +5721,6 @@ with pkgs;
    jdk = jdk8;
  };
  alan = callPackage ../development/compilers/alan { };
  alan_2 = callPackage ../development/compilers/alan/2.nix { };
  armips = callPackage ../development/compilers/armips {
    stdenv = gcc10Stdenv;
  };