Skip to content

Commit

Permalink
Adjust previous use of LD_PRELOAD to fix Solaris 11 build, hoping it'll
Browse files Browse the repository at this point in the history
fix the SmartOS bulk build (which gave similar errors, but which I
couldn't reproduce on my SmartOS or Tribblix systems).

Does not break:
- macOS 12.1
- NetBSD 9.2 and -current
- OpenBSD 7.0
- FreeBSD 13.0
- Tribblix m25.1
- CentOS 7 and 8
- Debian 9, 10, and 11
- Devuan 4
- Ubuntu 14, 16, 18, and 20
- Void
  • Loading branch information
schmonz committed Dec 27, 2021
1 parent e22a68b commit 2901d16
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
7 changes: 6 additions & 1 deletion sysutils/file/Makefile
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.49 2021/04/08 10:40:43 nia Exp $
# $NetBSD: Makefile,v 1.50 2021/12/27 23:25:08 schmonz Exp $

DISTNAME= file-5.40
CATEGORIES= sysutils
Expand All @@ -14,6 +14,11 @@ GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --enable-fsect-man5
CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR:Q}

SUBST_CLASSES+= paths
SUBST_STAGE.paths= pre-configure
SUBST_FILES.paths= magic/myfile
SUBST_VARS.paths= SH

MESSAGE_SUBST+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR}

TEST_TARGET= check
Expand Down
5 changes: 3 additions & 2 deletions sysutils/file/distinfo
@@ -1,8 +1,9 @@
$NetBSD: distinfo,v 1.40 2021/12/18 12:07:50 schmonz Exp $
$NetBSD: distinfo,v 1.41 2021/12/27 23:25:08 schmonz Exp $

BLAKE2s (file-5.40.tar.gz) = 81709bb3abd39d4eea0e8d93966f162496d89e5bfc7f9e88d6be31b86dd5ed75
SHA512 (file-5.40.tar.gz) = 3b70df75fa4c9050d55b1ffdc28e5f3c8b8ef7d4efd1a06bf53f113b676d81114a85aae56e0897d32b53716662d64ad18ab251ca8c92c6405c69eb758bb99afb
Size (file-5.40.tar.gz) = 1004214 bytes
SHA1 (patch-aa) = df1206c65ebbffca766ad77f7d98f8caa26a8b1c
SHA1 (patch-magic_Makefile.in) = ef956a9970ced035ad7f4241c66e56b2d07dddb0
SHA1 (patch-magic_Makefile.in) = 7870ab84573b2d2ce4b774083f073c620ba6f5d1
SHA1 (patch-magic_myfile) = a977950ad98fd633aae6dec8357353a5b5ceee9d
SHA1 (patch-src_fsmagic.c) = f862c5335bc3c6b0d39dfcdfd79e2d99407e40f5
4 changes: 2 additions & 2 deletions sysutils/file/patches/patch-magic_Makefile.in
@@ -1,4 +1,4 @@
$NetBSD: patch-magic_Makefile.in,v 1.1 2021/12/18 12:07:50 schmonz Exp $
$NetBSD: patch-magic_Makefile.in,v 1.2 2021/12/27 23:25:08 schmonz Exp $

Use the just-built libmagic, not whatever might be already installed.

Expand All @@ -9,7 +9,7 @@ Use the just-built libmagic, not whatever might be already installed.
fi; \
fi)
- $(FILE_COMPILE) -C -m magic
+ LD_PRELOAD=../src/.libs/libmagic.so ../src/.libs/file -C -m magic
+ chmod +x myfile && ./myfile magic
@rm -fr magic

# Tell versions [3.59,3.63) of GNU make to not export all variables.
15 changes: 15 additions & 0 deletions sysutils/file/patches/patch-magic_myfile
@@ -0,0 +1,15 @@
$NetBSD: patch-magic_myfile,v 1.1 2021/12/27 23:25:08 schmonz Exp $

Use the just-built libmagic, not whatever might be already installed.

--- magic/myfile.orig 2021-12-27 21:10:43.590323858 +0000
+++ magic/myfile
@@ -0,0 +1,8 @@
+#!@SH@
+
+set -e
+
+magicdir=$(pwd)
+cd ../src/.libs
+LD_PRELOAD=./libmagic.so.1 ./file -C -m "${magicdir}/$1"
+cp magic.mgc ${magicdir}

0 comments on commit 2901d16

Please sign in to comment.