hp2ps: install shell wrapper
authorSergei Trofimovich <slyfox@gentoo.org>
Mon, 3 Apr 2017 07:55:04 +0000 (08:55 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Mon, 3 Apr 2017 09:25:23 +0000 (10:25 +0100)
Before this change we installed hp2ps both
to inplace/bin/ and ${prefix}/bin/

In both cases we added $(CrossCompilePrefix) as
a binary prefix. It's incorrect for inplace install
as none of inplace binaries are prefixed.

The change it to track 'hp2ps' as unprefixed binary.
$(CrossCompilePrefix) prefix is only added to the
installed shell wrapper.

Now 'hp2ps' is handled in a similar way to 'hpc' and
'ghc-pkg'.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
utils/hp2ps/ghc.mk
utils/hp2ps/hp2ps.wrapper [new file with mode: 0644]

index 64a3a6d..f6e01ec 100644 (file)
@@ -16,11 +16,12 @@ utils/hp2ps_dist_C_SRCS          = AreaBelow.c Curves.c Error.c Main.c \
                                    Axes.c Dimensions.c Key.c PsFile.c Shade.c \
                                    Utilities.c
 utils/hp2ps_dist_EXTRA_LIBRARIES = m
-utils/hp2ps_dist_PROGNAME        = $(CrossCompilePrefix)hp2ps
+utils/hp2ps_dist_PROGNAME        = hp2ps
 utils/hp2ps_dist_INSTALL         = YES
 utils/hp2ps_dist_INSTALL_INPLACE = YES
+utils/hp2ps_dist_SHELL_WRAPPER              = YES
+utils/hp2ps_dist_INSTALL_SHELL_WRAPPER_NAME = hp2ps
 
 utils/hp2ps_CC_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS))
 
 $(eval $(call build-prog,utils/hp2ps,dist,0))
-
diff --git a/utils/hp2ps/hp2ps.wrapper b/utils/hp2ps/hp2ps.wrapper
new file mode 100644 (file)
index 0000000..22982ef
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec "$executablename" ${1+"$@"}