gnustep: cleanup

Cleaning up. Adding GNUstep package builder for abstracting out GNUstep
compilation specifics (with thanks to GitHub user lethalman).

The rules for using build_gnustep_package are as simple: any
GNUstep-based package that the package being compiled depends upon are
to be put in [deps] (this is used for setting up a buildEnv), while
other dependencies are put into [buildInputs] as usual.
This commit is contained in:
Artyom Shalkhakov 2014-12-07 22:52:03 +06:00 committed by Matthew Bauer
parent 5db3f3ee61
commit d39e5372dc
7 changed files with 195 additions and 133 deletions

View File

@ -3,6 +3,7 @@
, clang
, fetchurl
, gnustep_base, gnustep_make, gnustep_gui
, gnustep_builder
, xlibs
, x11
, freetype
@ -12,58 +13,14 @@
let
version = "0.24.0";
in
stdenv.mkDerivation rec {
gnustep_builder.mkDerivation rec {
name = "gnustep-back-${version}";
src = fetchurl {
url = "ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-back-0.24.0.tar.gz";
sha256 = "0qixbilkkrqxrhhj9hnp7ygd5gs23b3qbbgk3gaxj73d0xqfvhjz";
};
buildInputs = [ cairo clang freetype gnustep_base gnustep_make gnustep_gui pkgconfig x11 ];
propagatedBuildInputs = [ ];
GNUSTEP_env = buildEnv {
name = "gnustep-back-env";
paths = [ gnustep_make gnustep_base gnustep_gui ];
pathsToLink = [ "/bin" "/sbin" "/include" "/lib" "/share" ];
};
GNUSTEP_MAKEFILES = "${GNUSTEP_env}/share/GNUstep/Makefiles";
GNUSTEP_INSTALLATION_DOMAIN = "SYSTEM";
ADDITIONAL_CPPFLAGS = "-DGNUSTEP";
patches = [ ./fixup-tools.patch ];
dontBuild = true;
installPhase = ''
export ADDITIONAL_INCLUDE_DIRS=${GNUSTEP_env}/include
./configure
make \
GNUSTEP_SYSTEM_APPS=$GNUSTEP_env/lib/GNUstep/Applications \
GNUSTEP_SYSTEM_ADMIN_APPS=$GNUSTEP_env/lib/GNUstep/Applications \
GNUSTEP_SYSTEM_WEB_APPS=$GNUSTEP_env/lib/GNUstep/WebApplications \
GNUSTEP_SYSTEM_TOOLS=$GNUSTEP_env/bin \
GNUSTEP_SYSTEM_ADMIN_TOOLS=$GNUSTEP_env/sbin \
GNUSTEP_SYSTEM_LIBRARY=$GNUSTEP_env/lib/GNUstep \
GNUSTEP_SYSTEM_HEADERS=$GNUSTEP_env/include \
GNUSTEP_SYSTEM_LIBRARIES=$GNUSTEP_env/lib \
GNUSTEP_SYSTEM_DOC=$GNUSTEP_env/share/GNUstep/Documentation \
GNUSTEP_SYSTEM_DOC_MAN=$GNUSTEP_env/share/man \
GNUSTEP_SYSTEM_DOC_INFO=$GNUSTEP_env/share/info \
GNUSTEP_SYSTEM_LIBRARIES=$GNUSTEP_env/lib \
messages=yes
make install \
GNUSTEP_INSTALLATION_DOMAIN=SYSTEM \
GNUSTEP_SYSTEM_APPS=$out/lib/GNUstep/Applications \
GNUSTEP_SYSTEM_ADMIN_APPS=$out/lib/GNUstep/Applications \
GNUSTEP_SYSTEM_WEB_APPS=$out/lib/GNUstep/WebApplications \
GNUSTEP_SYSTEM_TOOLS=$out/bin \
GNUSTEP_SYSTEM_ADMIN_TOOLS=$out/sbin \
GNUSTEP_SYSTEM_LIBRARY=$out/lib/GNUstep \
GNUSTEP_SYSTEM_HEADERS=$out/include \
GNUSTEP_SYSTEM_LIBRARIES=$out/lib \
GNUSTEP_SYSTEM_DOC=$out/share/GNUstep/Documentation \
GNUSTEP_SYSTEM_DOC_MAN=$out/share/man \
GNUSTEP_SYSTEM_DOC_INFO=$out/share/info \
GNUSTEP_SYSTEM_LIBRARIES=$out/lib \
GNUSTEP_HEADERS=$out/include \
DESTDIR_GNUSTEP_MAKEFILES=$out/share/GNUstep/Makefiles
'';
buildInputs = [ cairo clang freetype pkgconfig x11 ];
deps = [ gnustep_make gnustep_base gnustep_gui ];
meta = {
description = "GNUstep-back is a generic backend for GNUstep.";
@ -72,6 +29,6 @@ stdenv.mkDerivation rec {
license = stdenv.lib.licenses.lgpl2Plus;
maintainers = with stdenv.lib.maintainers; [ ashalkhakov ];
platforms = stdenv.lib.platforms.all;
platforms = stdenv.lib.platforms.linux;
};
}

View File

@ -1,5 +1,5 @@
{ aspell, audiofile
, buildEnv
, gnustep_builder
, clang, cups
, fetchurl
, gmp, gnustep_make, gnutls
@ -15,7 +15,7 @@
let
version = "1.24.7";
in
stdenv.mkDerivation rec {
gnustep_builder.mkDerivation {
name = "gnustep-base-${version}";
src = fetchurl {
url = "ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-base-1.24.7.tar.gz";
@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
buildInputs = [
aspell audiofile
clang cups
gmp gnustep_make gnutls
gmp gnutls
libffi
libjpeg libtiff libpng giflib libungif
libxml2 libxslt libiconv
@ -44,34 +44,8 @@ stdenv.mkDerivation rec {
icu
portaudio
];
GNUSTEP_env = buildEnv {
name = "gnustep-make-env";
paths = [ gnustep_make ];
};
GNUSTEP_MAKEFILES = "${GNUSTEP_env}/share/GNUstep/Makefiles";
GNUSTEP_INSTALLATION_DOMAIN = "SYSTEM";
deps = [ gnustep_make ];
patches = [ ./fixup-base-makefile-installdir.patch ];
dontBuild = true;
installPhase = ''
./configure --disable-importing-config-file
make
make install \
GNUSTEP_INSTALLATION_DOMAIN=SYSTEM \
GNUSTEP_SYSTEM_APPS=$out/lib/GNUstep/Applications \
GNUSTEP_SYSTEM_ADMIN_APPS=$out/lib/GNUstep/Applications \
GNUSTEP_SYSTEM_WEB_APPS=$out/lib/GNUstep/WebApplications \
GNUSTEP_SYSTEM_TOOLS=$out/bin \
GNUSTEP_SYSTEM_ADMIN_TOOLS=$out/sbin \
GNUSTEP_SYSTEM_LIBRARY=$out/lib/GNUstep \
GNUSTEP_SYSTEM_HEADERS=$out/include \
GNUSTEP_SYSTEM_LIBRARIES=$out/lib \
GNUSTEP_SYSTEM_DOC=$out/share/GNUstep/Documentation \
GNUSTEP_SYSTEM_DOC_MAN=$out/share/man \
GNUSTEP_SYSTEM_DOC_INFO=$out/share/info \
GNUSTEP_SYSTEM_LIBRARIES=$out/lib \
GNUSTEP_HEADERS=$out/include \
DESTDIR_GNUSTEP_MAKEFILES=$out/share/GNUstep/Makefiles
'';
meta = {
description = "GNUstep-base is an implementation of AppKit and Foundation libraries of OPENSTEP and Cocoa.";
@ -80,6 +54,6 @@ stdenv.mkDerivation rec {
license = stdenv.lib.licenses.lgpl2Plus;
maintainers = with stdenv.lib.maintainers; [ ashalkhakov ];
platforms = stdenv.lib.platforms.all;
platforms = stdenv.lib.platforms.linux;
};
}

View File

@ -1,65 +1,23 @@
{ buildEnv
, clang
{
clang
, fetchurl
, gnustep_base, gnustep_make
, gnustep_builder
#, xlibs, x11, freetype
#, pkgconfig
, stdenv }:
let
version = "0.24.0";
in
stdenv.mkDerivation rec {
gnustep_builder.mkDerivation rec {
name = "gnustep-gui-${version}";
src = fetchurl {
url = "ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-gui-0.24.0.tar.gz";
sha256 = "0d6jzfcyacxjzrr2p398ysvs1akv1fcmngfzxxbfxa947miydjxg";
};
buildInputs = [ clang gnustep_base gnustep_make ];
propagatedBuildInputs = [ ];
GNUSTEP_env = buildEnv {
name = "gnustep-gui-env";
paths = [ gnustep_make gnustep_base ];
pathsToLink = [ "/bin" "/sbin" "/include" "/lib" "/share" ];
};
GNUSTEP_MAKEFILES = "${GNUSTEP_env}/share/GNUstep/Makefiles";
GNUSTEP_INSTALLATION_DOMAIN = "SYSTEM";
ADDITIONAL_CPPFLAGS = "-DGNUSTEP";
buildInputs = [ clang ];
deps = [ gnustep_base gnustep_make ];
patches = [ ./fixup-gui-makefile-installdir.patch ./fixup-gui-tools-preamble.patch ./fixup-gui-textconverters-preamble.patch ];
dontBuild = true;
installPhase = ''
export ADDITIONAL_INCLUDE_DIRS=${GNUSTEP_env}/include
./configure
make \
GNUSTEP_SYSTEM_APPS=$GNUSTEP_env/lib/GNUstep/Applications \
GNUSTEP_SYSTEM_ADMIN_APPS=$GNUSTEP_env/lib/GNUstep/Applications \
GNUSTEP_SYSTEM_WEB_APPS=$GNUSTEP_env/lib/GNUstep/WebApplications \
GNUSTEP_SYSTEM_TOOLS=$GNUSTEP_env/bin \
GNUSTEP_SYSTEM_ADMIN_TOOLS=$GNUSTEP_env/sbin \
GNUSTEP_SYSTEM_LIBRARY=$GNUSTEP_env/lib/GNUstep \
GNUSTEP_SYSTEM_HEADERS=$GNUSTEP_env/include \
GNUSTEP_SYSTEM_LIBRARIES=$GNUSTEP_env/lib \
GNUSTEP_SYSTEM_DOC=$GNUSTEP_env/share/GNUstep/Documentation \
GNUSTEP_SYSTEM_DOC_MAN=$GNUSTEP_env/share/man \
GNUSTEP_SYSTEM_DOC_INFO=$GNUSTEP_env/share/info \
GNUSTEP_SYSTEM_LIBRARIES=$GNUSTEP_env/lib \
messages=yes
make install \
GNUSTEP_INSTALLATION_DOMAIN=SYSTEM \
GNUSTEP_SYSTEM_APPS=$out/lib/GNUstep/Applications \
GNUSTEP_SYSTEM_ADMIN_APPS=$out/lib/GNUstep/Applications \
GNUSTEP_SYSTEM_WEB_APPS=$out/lib/GNUstep/WebApplications \
GNUSTEP_SYSTEM_TOOLS=$out/bin \
GNUSTEP_SYSTEM_ADMIN_TOOLS=$out/sbin \
GNUSTEP_SYSTEM_LIBRARY=$out/lib/GNUstep \
GNUSTEP_SYSTEM_HEADERS=$out/include \
GNUSTEP_SYSTEM_LIBRARIES=$out/lib \
GNUSTEP_SYSTEM_DOC=$out/share/GNUstep/Documentation \
GNUSTEP_SYSTEM_DOC_MAN=$out/share/man \
GNUSTEP_SYSTEM_DOC_INFO=$out/share/info \
GNUSTEP_SYSTEM_LIBRARIES=$out/lib \
GNUSTEP_HEADERS=$out/include \
DESTDIR_GNUSTEP_MAKEFILES=$out/share/GNUstep/Makefiles
'';
meta = {
description = "GNUstep-gui is a GUI class library of GNUstep.";
@ -68,6 +26,6 @@ stdenv.mkDerivation rec {
license = stdenv.lib.licenses.lgpl2Plus;
maintainers = with stdenv.lib.maintainers; [ ashalkhakov ];
platforms = stdenv.lib.platforms.all;
platforms = stdenv.lib.platforms.linux;
};
}

View File

@ -0,0 +1,126 @@
# These GNUSTEP_*_ROOT variables are obsolete, and will be removed.
#GNUSTEP_SYSTEM_ROOT=/nix/store/ky64z3j9l18wjcssb9pxnc792ihh3bvw-gnustep-make-2.6.6/System
#GNUSTEP_LOCAL_ROOT=/nix/store/ky64z3j9l18wjcssb9pxnc792ihh3bvw-gnustep-make-2.6.6/Local
#GNUSTEP_NETWORK_ROOT=/nix/store/ky64z3j9l18wjcssb9pxnc792ihh3bvw-gnustep-make-2.6.6/Network
# The name of the user config file. This file can override
# some settings in this file. Usually used by users that want
# to install things into their GNUstep user domain and/or have
# many such domains.
GNUSTEP_USER_CONFIG_FILE=.GNUstep.conf
# The name of the user directory, if any. This is obsolete,
# and will be removed.
GNUSTEP_USER_DIR=GNUstep
# The name of the user directory where defaults (eg, preferences) are
# stored. If it does not start with a '/', it will be considered
# relative to the user home directory.
GNUSTEP_USER_DEFAULTS_DIR=GNUstep/Defaults
# This is where the gnustep-make Makefiles are installed.
# Traditionally, this is /usr/GNUstep/System/Library/Makefiles
GNUSTEP_MAKEFILES=@gnustepMakefiles@
# This is where the user home directories are. Only used to provide
# NSUserDirectory in gnustep-base. Never used anywhere else.
GNUSTEP_SYSTEM_USERS_DIR=/home
GNUSTEP_NETWORK_USERS_DIR=/home
GNUSTEP_LOCAL_USERS_DIR=/home
# This is where System GUI Applications get installed.
# Traditionally it is /usr/GNUstep/System/Applications.
GNUSTEP_SYSTEM_APPS=@systemApps@
# This is where System GUI Applications that only the
# Administrator can use get installed.
# Traditionally it is /usr/GNUstep/System/Applications/Admin.
GNUSTEP_SYSTEM_ADMIN_APPS=@systemAdminApps@
# This is where System Web Applications (GSWeb, SOPE) get
# installed.
# Traditionally it is /usr/GNUstep/System/Library/WebApplications.
GNUSTEP_SYSTEM_WEB_APPS=@systemWebApps@
# This is where System Command-Line Tools get installed.
# Traditionally it is /usr/GNUstep/System/Tools.
GNUSTEP_SYSTEM_TOOLS=@systemTools@
# This is where System Command-Line Tools that only the
# Administrator can use get installed. Important: this
# should not be in the PATH of normal users.
# Traditionally it is /usr/GNUstep/System/Tools/Admin.
GNUSTEP_SYSTEM_ADMIN_TOOLS=@systemAdminTools@
# This is where System resources get installed. This directory will
# contain a lot of executable code since *step traditionally likes to
# bundle executables and resources together.
# Traditionally it is /usr/GNUstep/System/Library.
GNUSTEP_SYSTEM_LIBRARY=@systemLibrary@
# This is where System headers get installed. They are the
# library .h headers.
# Traditionally it is /usr/GNUstep/System/Library/Headers.
GNUSTEP_SYSTEM_HEADERS=@systemHeaders@
# This is where System libraries get installed. By libraries we mean
# the shared/static object files that you can link into programs.
# Traditionally it is /usr/GNUstep/System/Library/Libraries.
GNUSTEP_SYSTEM_LIBRARIES=@systemLibraries@
# This is where System documentation get installed. This is known
# not to contain any executable, so we keep it separate.
# Traditionally it is /usr/GNUstep/System/Library/Documentation.
GNUSTEP_SYSTEM_DOC=@systemDoc@
# This is where System man pages get installed.
# Traditionally it is /usr/GNUstep/System/Library/Documentation/man.
GNUSTEP_SYSTEM_DOC_MAN=@systemDocMan@
# This is where System info pages get installed.
# Traditionally it is /usr/GNUstep/System/Library/Documentation/info.
GNUSTEP_SYSTEM_DOC_INFO=@systemDocInfo@
GNUSTEP_NETWORK_APPS=@systemApps@
GNUSTEP_NETWORK_ADMIN_APPS=@systemAdminApps@
GNUSTEP_NETWORK_WEB_APPS=@systemWebApps@
GNUSTEP_NETWORK_TOOLS=@systemTools@
GNUSTEP_NETWORK_ADMIN_TOOLS=@systemAdminTools@
GNUSTEP_NETWORK_LIBRARY=@systemLibrary@
GNUSTEP_NETWORK_HEADERS=@systemHeaders@
GNUSTEP_NETWORK_LIBRARIES=@systemLibraries@
GNUSTEP_NETWORK_DOC=@systemDoc@
GNUSTEP_NETWORK_DOC_MAN=@systemDocMan@
GNUSTEP_NETWORK_DOC_INFO=@systemDocInfo@
GNUSTEP_LOCAL_APPS=@systemApps@
GNUSTEP_LOCAL_ADMIN_APPS=@systemAdminApps@
GNUSTEP_LOCAL_WEB_APPS=@systemWebApps@
GNUSTEP_LOCAL_TOOLS=@systemTools@
GNUSTEP_LOCAL_ADMIN_TOOLS=@systemAdminTools@
GNUSTEP_LOCAL_LIBRARY=@systemLibrary@
GNUSTEP_LOCAL_HEADERS=@systemHeaders@
GNUSTEP_LOCAL_LIBRARIES=@systemLibraries@
GNUSTEP_LOCAL_DOC=@systemDoc@
GNUSTEP_LOCAL_DOC_MAN=@systemDocMan@
GNUSTEP_LOCAL_DOC_INFO=@systemDocInfo@
# Important: settings in the User should normally be relative paths,
# and will be interpreted as relative to the user's directory. This
# allows each user to have their own domain to install things. You
# can set them to be absolute, mostly if you want to disable them
# by setting them equal to the ones in the Network domain.
GNUSTEP_USER_DIR_APPS=GNUstep/Applications
GNUSTEP_USER_DIR_ADMIN_APPS=GNUstep/Applications/Admin
GNUSTEP_USER_DIR_WEB_APPS=GNUstep/WebApplications
GNUSTEP_USER_DIR_TOOLS=GNUstep/Tools
GNUSTEP_USER_DIR_ADMIN_TOOLS=GNUstep/Tools/Admin
GNUSTEP_USER_DIR_LIBRARY=GNUstep/Library
GNUSTEP_USER_DIR_HEADERS=GNUstep/Library/Headers
GNUSTEP_USER_DIR_LIBRARIES=GNUstep/Library/Libraries
GNUSTEP_USER_DIR_DOC=GNUstep/Library/Documentation
GNUSTEP_USER_DIR_DOC_MAN=GNUstep/Library/Documentation/man
GNUSTEP_USER_DIR_DOC_INFO=GNUstep/Library/Documentation/info

View File

@ -0,0 +1,44 @@
{ stdenv, gnustep_make, buildEnv}:
with stdenv.lib;
{
mkDerivation =
args @ { name, src, deps ? [], buildInputs, ... }:
let
GNUSTEP_env =
# buildEnv fails if there is only one path to symlink
if deps == null || length deps < 2 then gnustep_make
else buildEnv {
name = "gnustep-env-${name}";
paths = deps;
pathsToLink = [ "/bin" "/sbin" "/lib" "/include" "/share" ];
};
in
stdenv.mkDerivation (args // {
GNUSTEP_conf = gnustep_make.gnustepConfigTemplate;
inherit GNUSTEP_env;
GNUSTEP_MAKEFILES = "${GNUSTEP_env}/share/GNUstep/Makefiles";
GNUSTEP_INSTALLATION_DOMAIN = "SYSTEM";
buildInputs = args.buildInputs ++ deps;
preConfigure = ''
cp $GNUSTEP_conf $(pwd)/GNUstep-build.conf
substituteInPlace $(pwd)/GNUstep-build.conf \
--subst-var-by gnustepMakefiles $GNUSTEP_MAKEFILES \
--subst-var-by systemApps "$GNUSTEP_env/lib/GNUstep/Applications" \
--subst-var-by systemAdminApps "$GNUSTEP_env/lib/GNUstep/Applications" \
--subst-var-by systemWebApps "$GNUSTEP_env/lib/GNUstep/WebApplications" \
--subst-var-by systemTools "$GNUSTEP_env/bin" \
--subst-var-by systemAdminTools "$GNUSTEP_env/sbin" \
--subst-var-by systemLibrary "$GNUSTEP_env/lib" \
--subst-var-by systemHeaders "$GNUSTEP_env/include" \
--subst-var-by systemLibraries "$GNUSTEP_env/lib" \
--subst-var-by systemDoc "$GNUSTEP_env/share/GNUstep/Documentation" \
--subst-var-by systemDocMan "$GNUSTEP_env/share/man" \
--subst-var-by systemDocInfo "$GNUSTEP_env/share/info"
export GNUSTEP_CONFIG_FILE=$(pwd)/GNUstep-build.conf
. $GNUSTEP_MAKEFILES/GNUstep.sh
'';
installFlags = "GNUSTEP_SYSTEM_APPS=\${out}/lib/GNUstep/Applications GNUSTEP_SYSTEM_ADMIN_APPS=\${out}/lib/GNUstep/Applications GNUSTEP_SYSTEM_WEB_APPS=\${out}/lib/GNUstep/WebApplications GNUSTEP_SYSTEM_TOOLS=\${out}/bin GNUSTEP_SYSTEM_ADMIN_TOOLS=\${out}/sbin GNUSTEP_SYSTEM_LIBRARY=\${out}/lib GNUSTEP_SYSTEM_HEADERS=\${out}/include GNUSTEP_SYSTEM_LIBRARIES=\${out}/lib GNUSTEP_SYSTEM_DOC=\${out}/share/GNUstep/Documentation GNUSTEP_SYSTEM_DOC_MAN=\${out}/share/man GNUSTEP_SYSTEM_DOC_INFO=\${out}/share/info GNUSTEP_SYSTEM_LIBRARIES=\${out}/lib GNUSTEP_HEADERS=\${out}/include DESTDIR_GNUSTEP_MAKEFILES=\${out}/share/GNUstep/Makefiles";
});
}

View File

@ -8,8 +8,9 @@ stdenv.mkDerivation rec {
url = "ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-make-2.6.6.tar.gz";
sha256 = "07cqr8x17bia9w6clbmiv7ay6r9nplrjz2cyzinv4w7zfpc19vxw";
};
configureFlags = "--with-layout=fhs-system";
configureFlags = "--with-installation-domain=SYSTEM";
buildInputs = [ clang which libobjc2 ];
gnustepConfigTemplate = ./GNUstep.conf;
meta = {
description = "GNUstep-make is a build manager for GNUstep.";
@ -18,6 +19,6 @@ stdenv.mkDerivation rec {
license = stdenv.lib.licenses.lgpl2Plus;
maintainers = with stdenv.lib.maintainers; [ ashalkhakov ];
platforms = stdenv.lib.platforms.all;
platforms = stdenv.lib.platforms.linux;
};
}

View File

@ -6444,10 +6444,12 @@ in
gnumake42 = callPackage ../development/tools/build-managers/gnumake/4.2 { };
gnumake = self.gnumake42;
gnustep_back = callPackage ../development/libraries/gnustep-back { stdenv = clangStdenv; };
gnustep_base = callPackage ../development/libraries/gnustep-base { stdenv = clangStdenv; giflib = giflib_4_1; };
gnustep_builder = import ../development/tools/build-managers/gnustep-make/build-gnustep-package.nix { stdenv = clangStdenv; inherit gnustep_make; inherit buildEnv; };
gnustep_back = callPackage ../development/libraries/gnustep-back { };
gnustep_base = callPackage ../development/libraries/gnustep-base { giflib = giflib_4_1; };
gnustep_make = callPackage ../development/tools/build-managers/gnustep-make { stdenv = clangStdenv; };
gnustep_gui = callPackage ../development/libraries/gnustep-gui { stdenv = clangStdenv; };
gnustep_gui = callPackage ../development/libraries/gnustep-gui { };
gob2 = callPackage ../development/tools/misc/gob2 { };