From e975681deb94b51f4f315112ec6b2622f84a81d0 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 9 Sep 2023 17:58:05 -0300 Subject: [PATCH] _4th: refactor - Migrate to by-name - Split outputs - finalAttrs --- .../_4/_4th}/001-install-manual-fixup.diff | 0 .../_4/_4th/package.nix} | 30 +++++++++++-------- pkgs/top-level/all-packages.nix | 2 -- 3 files changed, 18 insertions(+), 14 deletions(-) rename pkgs/{development/compilers/4th => by-name/_4/_4th}/001-install-manual-fixup.diff (100%) rename pkgs/{development/compilers/4th/default.nix => by-name/_4/_4th/package.nix} (55%) diff --git a/pkgs/development/compilers/4th/001-install-manual-fixup.diff b/pkgs/by-name/_4/_4th/001-install-manual-fixup.diff similarity index 100% rename from pkgs/development/compilers/4th/001-install-manual-fixup.diff rename to pkgs/by-name/_4/_4th/001-install-manual-fixup.diff diff --git a/pkgs/development/compilers/4th/default.nix b/pkgs/by-name/_4/_4th/package.nix similarity index 55% rename from pkgs/development/compilers/4th/default.nix rename to pkgs/by-name/_4/_4th/package.nix index e2fd7567f11e..18811f5b9bf7 100644 --- a/pkgs/development/compilers/4th/default.nix +++ b/pkgs/by-name/_4/_4th/package.nix @@ -1,14 +1,19 @@ -{ lib, stdenv, fetchurl }: +{ lib +, stdenv +, fetchurl +}: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "4th"; version = "3.64.1"; src = fetchurl { - url = "https://sourceforge.net/projects/forth-4th/files/${pname}-${version}/${pname}-${version}-unix.tar.gz"; + url = "https://sourceforge.net/projects/forth-4th/files/4th-${finalAttrs.version}/4th-${finalAttrs.version}-unix.tar.gz"; hash = "sha256-+W6nTNsqrf3Dvr+NbSz3uJdrXVbBI3OHR5v/rs7en+M="; }; + outputs = [ "out" "man" ]; + patches = [ # Fix install manual; report this patch to upstream ./001-install-manual-fixup.diff @@ -23,24 +28,25 @@ stdenv.mkDerivation rec { preInstall = '' install -d ${placeholder "out"}/bin \ - ${placeholder "out"}/lib \ - ${placeholder "out"}/share/doc/${pname} \ - ${placeholder "out"}/share/man + ${placeholder "out"}/lib \ + ${placeholder "out"}/share/doc/4th \ + ${placeholder "man"}/share/man ''; installFlags = [ "BINARIES=${placeholder "out"}/bin" "LIBRARIES=${placeholder "out"}/lib" "DOCDIR=${placeholder "out"}/share/doc" - "MANDIR=${placeholder "out"}/share/man" + "MANDIR=${placeholder "man"}/share/man" ]; - meta = with lib; { + meta = { homepage = "https://thebeez.home.xs4all.nl/4tH/index.html"; description = "A portable Forth compiler"; - license = licenses.lgpl3Plus; - maintainers = with maintainers; [ AndersonTorres ]; - platforms = platforms.unix; + license = lib.licenses.lgpl3Plus; + mainProgram = "4th"; + maintainers = with lib.maintainers; [ AndersonTorres ]; + platforms = lib.platforms.unix; }; -} +}) # TODO: set Makefile according to platform diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cff1fcfb16d5..11c1017db35b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15443,8 +15443,6 @@ with pkgs; ### DEVELOPMENT / COMPILERS - _4th = callPackage ../development/compilers/4th { }; - temurin-bin-20 = javaPackages.compiler.temurin-bin.jdk-20; temurin-jre-bin-20 = javaPackages.compiler.temurin-bin.jre-20;