pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/45046: mk/* minix support



>Number:         45046
>Category:       pkg
>Synopsis:       mk/* minix support
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 10 15:45:00 +0000 2011
>Originator:     Thomas Cort
>Release:        N/A
>Organization:
Minix3
>Environment:
Minix 192.168.122.210 3.2.0 i686
>Description:
The core pkgsrc makefiles don't support Minix.
>How-To-Repeat:
Try to run pkgsrc on Minix without the changes provided below.
>Fix:
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 094f902..874dcdd 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -482,7 +482,7 @@ PKG_FAIL_REASON+= "${PKGNAME} is restricted:" \
 PKG_FAIL_REASON+= "${PKGNAME} may not be built, because it utilizes strong 
cryptography"
 .    endif
 .  endif
-.  if defined(USE_X11) && (${X11_TYPE} == "native") && !exists(${X11BASE})
+.  if defined(USE_X11) && (${X11_TYPE} == "native") && !exists(${X11BASE}) && 
(${OPSYS} != "Minix")
 PKG_FAIL_REASON+= "${PKGNAME} uses X11, but ${X11BASE} not found"
 .  endif
 .  if defined(BROKEN)
@@ -647,7 +647,11 @@ _BIN_INSTALL_FLAGS+=       -A
 .endif
 _BIN_INSTALL_FLAGS+=   ${PKG_ARGS_ADD}
 
+.if ${OPSYS} == "Minix"
+_SHORT_UNAME_R=        ${:!${UNAME} -r!:} # full uname -r output
+.else
 _SHORT_UNAME_R=        ${:!${UNAME} -r!:C@\.([0-9]*)[_.-].*@.\1@} # 
n.n[_.]anything => n.n
+.endif
 
 .include "install/bin-install.mk"
 
diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk
index 46e3222..cefe6c9 100644
--- a/mk/bsd.prefs.mk
+++ b/mk/bsd.prefs.mk
@@ -279,6 +279,17 @@ LOWER_VENDOR?=             sun
 LOWER_OPSYS?=          solaris
 LOWER_OPSYS_VERSUFFIX= 2
 
+.elif ${OPSYS} == "Minix"
+OS_VERSION!= echo `${UNAME} -v`
+LOWER_OS_VERSION= OS_VERSION
+LOWER_ARCH!=           ${UNAME} -p
+MACHINE_ARCH?=         ${LOWER_ARCH}
+.if ${MACHINE_ARCH} == "unknown"
+MACHINE_ARCH=          ${LOWER_ARCH}
+.endif
+LOWER_VENDOR?=pc
+LOWER_OPSYS:=          ${OPSYS:tl}
+CPPFLAGS+=     -D_MINIX -D_POSIX_SOURCE
 .elif !defined(LOWER_OPSYS)
 LOWER_OPSYS:=          ${OPSYS:tl}
 .endif
@@ -549,6 +560,8 @@ X11BASE?=   /usr
 .  elif !empty(MACHINE_PLATFORM:MDarwin-9.*-*) || \
         !empty(MACHINE_PLATFORM:MDarwin-??.*-*)
 X11BASE?=      /usr/X11
+.  elif ${OPSYS} == "Minix"
+X11BASE?=      ${LOCALBASE}/X11R6
 .  elif exists(/usr/X11R7/lib/libX11.so)
 X11BASE?=      /usr/X11R7
 .  else
diff --git a/mk/buildlink3/imake-check b/mk/buildlink3/imake-check
index c337d20..cc73165 100755
--- a/mk/buildlink3/imake-check
+++ b/mk/buildlink3/imake-check
@@ -86,8 +86,8 @@ then
 fi
 
 # Run imake to process the Imakefile.
-${IMAKE} -DUseInstalled -I${X11BASE}/lib/X11/config -s - |
-${IMAKE_MAKE} -f - builtin-test |
+${IMAKE} -DUseInstalled -I${X11BASE}/lib/X11/config
+${IMAKE_MAKE} builtin-test |
 ${GREP} -q yes
 exitcode="$?"
 
diff --git a/mk/fetch/sites.mk b/mk/fetch/sites.mk
index 169f880..3315ffe 100644
--- a/mk/fetch/sites.mk
+++ b/mk/fetch/sites.mk
@@ -465,3 +465,5 @@ MASTER_SITE_BACKUP?=        \
        ftp://ftp.NetBSD.org/pub/pkgsrc/distfiles/ \
        http://ftp.NetBSD.org/pub/pkgsrc/distfiles/ \
        ftp://ftp.FreeBSD.org/pub/FreeBSD/distfiles/
+
+MASTER_SITE_MINIX=http://www.minix3.org/distfiles-minix/
diff --git a/mk/install/bin-install.mk b/mk/install/bin-install.mk
index 0400f8f..60e3785 100644
--- a/mk/install/bin-install.mk
+++ b/mk/install/bin-install.mk
@@ -32,6 +32,8 @@
 .if ${OPSYS} == "NetBSD"
 BINPKG_SITES?= \
        ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/$${arch}/$${rel}
+.elif ${OPSYS} == "Minix"
+BINPKG_SITES?= ftp://ftp.minix3.org/pub/minix/packages/$${rel}/$${arch}
 .elif ${OPSYS} == "DragonFly"
 BINPKG_SITES?= \
        
http://mirror-master.dragonflybsd.org/packages/$${arch}/DragonFly-$${rel}/stable
diff --git a/mk/pkginstall/dirs b/mk/pkginstall/dirs
index c783cbf..611be47 100644
--- a/mk/pkginstall/dirs
+++ b/mk/pkginstall/dirs
@@ -77,6 +77,12 @@ PKG_METADATA_DIR="${2-${CURDIR}}"
 
 PKG_REFCOUNT_DIRS_DBDIR="${PKG_REFCOUNT_DBDIR}/dirs"
 
+if ${TEST} -n "${PKG_DESTDIR}"; then
+       PKG_DBDIR="${PKG_DESTDIR}${PKG_DBDIR}"
+       PKG_REFCOUNT_DBDIR="${PKG_DESTDIR}${PKG_REFCOUNT_DBDIR}"
+       PKG_REFCOUNT_DIRS_DBDIR="${PKG_DESTDIR}${PKG_REFCOUNT_DIRS_DBDIR}"
+fi
+
 case "${PKG_CONFIG:-@PKG_CONFIG@}" in
 [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
        _PKG_CONFIG=yes
@@ -111,6 +117,7 @@ ADD)
                perms="$shadow_dir/+PERMISSIONS"
                preexist="$shadow_dir/+PREEXISTING"
                token="$shadow_dir/${PKGNAME}"
+               dir="${PKG_DESTDIR}$dir"
                if ${TEST} ! -d "$shadow_dir"; then
                        ${MKDIR} $shadow_dir
                        ${TEST} ! -d "$dir" ||
@@ -162,6 +169,7 @@ REMOVE)
                preexist="$shadow_dir/+PREEXISTING"
                token="$shadow_dir/${PKGNAME}"
                tokentmp="$token.tmp.$$"
+               dir="${PKG_DESTDIR}$dir"
                if ${TEST} -f "$token" && \
                   ${GREP} "^${PKG_METADATA_DIR}$" $token >/dev/null; then
                        ${CAT} "$token" | ${GREP} -v "^${PKG_METADATA_DIR}$" > 
$tokentmp
@@ -193,7 +201,7 @@ PERMS)
                esac
                case $dir in
                "")     continue ;;
-               [!/]*)  dir="${PKG_PREFIX}/$dir" ;;
+               [!/]*)  dir="${PKG_DESTDIR}${PKG_PREFIX}/$dir" ;;
                esac
                case $d_user in
                "")     ;;
@@ -215,7 +223,7 @@ CHECK-ADD)
        { while read dir d_flags d_mode d_user d_group; do
                case $dir in
                "")     continue ;;
-               [!/]*)  dir="${PKG_PREFIX}/$dir" ;;
+               [!/]*)  dir="${PKG_DESTDIR}${PKG_PREFIX}/$dir" ;;
                esac
                ${TEST} ! -d "$dir" || continue
                case $d_flags in
@@ -262,6 +270,7 @@ CHECK-REMOVE)
                esac
                shadow_dir="${PKG_REFCOUNT_DIRS_DBDIR}$dir"
                ${TEST} ! -d "$shadow_dir" || continue  # refcount isn't zero
+               dir="${PKG_DESTDIR}$dir"
                case "$printed_header" in
                yes)    ;;
                *)      printed_header=yes
@@ -290,7 +299,7 @@ CHECK-PERMS)
        { while read dir d_flags d_mode d_user d_group; do
                case $dir in
                "")     continue ;;
-               [!/]*)  dir="${PKG_PREFIX}/$dir" ;;
+               [!/]*)  dir="${PKG_DESTDIR}${PKG_PREFIX}/$dir" ;;
                esac
                ${TEST} -d "$dir" || continue
                case $d_user:$d_group:$d_mode in
diff --git a/mk/pkginstall/files b/mk/pkginstall/files
index 15ed967..489c238 100644
--- a/mk/pkginstall/files
+++ b/mk/pkginstall/files
@@ -114,6 +114,12 @@ VIEW-REMOVE)
        ;;
 esac
 
+if ${TEST} -n "${PKG_DESTDIR}"; then
+       PKG_DBDIR="${PKG_DESTDIR}${PKG_DBDIR}"
+       PKG_REFCOUNT_DBDIR="${PKG_DESTDIR}${PKG_REFCOUNT_DBDIR}"
+       PKG_REFCOUNT_FILES_DBDIR="${PKG_DESTDIR}${PKG_REFCOUNT_FILES_DBDIR}"
+fi
+
 exitcode=0
 case $ACTION in
 ADD)
@@ -136,6 +142,9 @@ ADD)
                perms="$shadow_dir/+PERMISSIONS"
                preexist="$shadow_dir/+PREEXISTING"
                token="$shadow_dir/${PKGNAME}"
+               file="${PKG_DESTDIR}$file"
+               f_eg="${PKG_DESTDIR}$f_eg"
+
                if ${TEST} ! -d "$shadow_dir"; then
                        ${MKDIR} $shadow_dir
                        ${TEST} ! -f "$file" ||
@@ -202,6 +211,9 @@ REMOVE)
                preexist="$shadow_dir/+PREEXISTING"
                token="$shadow_dir/${PKGNAME}"
                tokentmp="$token.tmp.$$"
+               file="${PKG_DESTDIR}$file"
+               f_eg="${PKG_DESTDIR}$f_eg"
+
                if ${TEST} -f "$token" && \
                   ${GREP} "^${PKG_METADATA_DIR}$" $token >/dev/null; then
                        ${CAT} "$token" | ${GREP} -v "^${PKG_METADATA_DIR}$" > 
$tokentmp
@@ -237,7 +249,7 @@ PERMS)
                esac
                case $file in
                "")     continue ;;
-               [!/]*)  file="${PKG_PREFIX}/$file" ;;
+               [!/]*)  file="${PKG_DESTDIR}${PKG_PREFIX}/$file" ;;
                esac
                case $f_user in
                "")     ;;
@@ -275,7 +287,7 @@ CHECK-ADD)
        { while read file f_flags f_eg f_mode f_user f_group; do
                case $file in
                "")     continue ;;
-               [!/]*)  file="${PKG_PREFIX}/$file" ;;
+               [!/]*)  file="${PKG_DESTDIR}${PKG_PREFIX}/$file" ;;
                esac
                ${TEST} ! -f "$file" || continue
                case $f_flags in
@@ -284,7 +296,7 @@ CHECK-ADD)
                esac
                case $f_eg in
                "")     continue ;;
-               [!/]*)  f_eg="${PKG_PREFIX}/$f_eg" ;;
+               [!/]*)  f_eg="${PKG_DESTDIR}${PKG_PREFIX}/$f_eg" ;;
                esac
 
                case "$printed_header" in
@@ -330,6 +342,8 @@ CHECK-REMOVE)
                ${TEST} -f "$file" || continue
                shadow_dir="${PKG_REFCOUNT_FILES_DBDIR}$file"
                ${TEST} ! -d "$shadow_dir" || continue  # refcount isn't zero
+               file="${PKG_DESTDIR}$file"
+
                case "$printed_header" in
                yes)    ;;
                *)      printed_header=yes
@@ -358,7 +372,7 @@ CHECK-PERMS)
        { while read file f_flags f_eg f_mode f_user f_group; do
                case $file in
                "")     continue ;;
-               [!/]*)  file="${PKG_PREFIX}/$file" ;;
+               [!/]*)  file="${PKG_DESTDIR}${PKG_PREFIX}/$file" ;;
                esac
                ${TEST} -f "$file" || continue
                case $f_mode:$f_user:$f_group in
diff --git a/mk/platform/Minix.mk b/mk/platform/Minix.mk
new file mode 100644
index 0000000..a87c1c1
--- /dev/null
+++ b/mk/platform/Minix.mk
@@ -0,0 +1,87 @@
+# $NetBSD: Linux.mk,v 1.37 2010/03/18 22:46:01 sbd Exp $
+#
+# Variable definitions for the Minix operating system.
+
+ECHO_N?=       ${ECHO} -n
+.if !defined(X11_TYPE) || ${X11_TYPE} == "native"
+IMAKE_MAKE?=   ${MAKE} # program which gets invoked by imake
+.endif
+IMAKEOPTS+=    -DBuildHtmlManPages=NO
+PKGLOCALEDIR?= share
+PS?=           /usr/bin/ps
+# XXX: default from defaults/mk.conf.  Verify/correct for this platform
+# and remove this comment.
+SU?=           /usr/bin/su
+TYPE?=         type                    # Shell builtin
+
+CPP_PRECOMP_FLAGS?=    # unset
+DEF_UMASK?=            022
+DEFAULT_SERIAL_DEVICE?=        /dev/null
+EXPORT_SYMBOLS_LDFLAGS?=       # Don't add symbols to the dynamic symbol table
+GROUPADD?=
+NOLOGIN?=              /bin/false
+PKG_TOOLS_BIN?=                ${LOCALBASE}/sbin
+ROOT_CMD?=             ${SU} - root -c
+ROOT_GROUP?=   operator
+ROOT_USER?=            root
+SERIAL_DEVICES?=       /dev/null
+USERADD?=              /usr/bin/useradd
+ULIMIT_CMD_datasize?=  : 
+
+# imake installs manpages in weird places
+# these values from /usr/X11R6/lib/X11/config/linux.cf
+IMAKE_MAN_SOURCE_PATH= man/man
+IMAKE_MAN_SUFFIX=      1x
+IMAKE_LIBMAN_SUFFIX=   3x
+IMAKE_KERNMAN_SUFFIX=  4
+IMAKE_FILEMAN_SUFFIX=  5x
+IMAKE_GAMEMAN_SUFFIX=  6
+IMAKE_MISCMAN_SUFFIX=  7
+IMAKE_MAN_DIR=         ${IMAKE_MAN_SOURCE_PATH}1
+IMAKE_LIBMAN_DIR=      ${IMAKE_MAN_SOURCE_PATH}3
+IMAKE_KERNMAN_DIR=     ${IMAKE_MAN_SOURCE_PATH}4
+IMAKE_FILEMAN_DIR=     ${IMAKE_MAN_SOURCE_PATH}5
+IMAKE_GAMEMAN_DIR=     ${IMAKE_MAN_SOURCE_PATH}6
+IMAKE_MISCMAN_DIR=     ${IMAKE_MAN_SOURCE_PATH}7
+IMAKE_MANNEWSUFFIX=    ${IMAKE_MAN_SUFFIX}
+IMAKE_MANINSTALL?=     maninstall catinstall
+
+_OPSYS_HAS_INET6=      no      # IPv6 is not standard
+_OPSYS_HAS_JAVA=       no      # Java is not standard
+_OPSYS_HAS_MANZ=       no      # no MANZ for gzipping of man pages
+_OPSYS_HAS_OSSAUDIO=   no      # libossaudio is available
+_OPSYS_PERL_REQD=              # no base version of perl required
+_OPSYS_PTHREAD_AUTO=   no      # -lpthread needed for pthreads
+_OPSYS_SHLIB_TYPE=             a.out # XXX Is this right?
+_PATCH_CAN_BACKUP=     yes     # native patch(1) can make backups
+_PATCH_BACKUP_ARG?=    -b -V simple --suffix   # switch to patch(1) for backup 
suffix
+_USE_RPATH=            no      # add rpath to LDFLAGS
+
+# flags passed to the linker to extract all symbols from static archives.
+# this is GNU ld.
+_OPSYS_WHOLE_ARCHIVE_FLAG=     -Wl,--whole-archive
+_OPSYS_NO_WHOLE_ARCHIVE_FLAG=  -Wl,--no-whole-archive
+
+_STRIPFLAG_CC?=                ${_INSTALL_UNSTRIPPED:D:U-s}    # cc(1) option 
to strip
+_STRIPFLAG_INSTALL?=   ${_INSTALL_UNSTRIPPED:D:U-s}    # install(1) option to 
strip
+
+_OPSYS_CAN_CHECK_SHLIBS=       no # can't use readelf in 
check/bsd.check-vars.mk
+
+# check for maximum command line length and set it in configure's environment,
+# to avoid a test required by the libtool script that takes forever.
+# FIXME: Adjust to work on this system and enable the lines below.
+#_OPSYS_MAX_CMDLEN_CMD=        /sbin/sysctl -n kern.argmax
+
+# If games are to be installed setgid, then SETGIDGAME is set to 'yes'
+# (it defaults to 'no' as per defaults/mk.conf).
+# Set the group and mode to meaningful values in that case (defaults to
+# BINOWN, BINGRP and BINMODE as per defaults/mk.conf).
+# FIXME: Adjust to work on this system and enable the lines below.
+#.if !(empty(SETGIDGAME:M[yY][eE][sS]))
+#GAMES_USER=           games
+#GAMES_GROUP=          games
+#GAMEOWN=              ${GAMES_USER}
+#GAMEGRP=              ${GAMES_GROUP}
+#GAMEMODE=             2555
+#GAMEDIRMODE=          0775
+#.endif
diff --git a/mk/tools/tools.Minix.mk b/mk/tools/tools.Minix.mk
new file mode 100644
index 0000000..5d91e77
--- /dev/null
+++ b/mk/tools/tools.Minix.mk
@@ -0,0 +1,64 @@
+# $NetBSD: tools.Linux.mk,v 1.47 2010/02/13 08:30:59 obache Exp $
+#
+# System-supplied tools for the Minix operating system.
+
+#System supplied tools
+TOOLS_PLATFORM.[?=             /bin/[
+TOOLS_PLATFORM.awk?=           /usr/bin/awk
+TOOLS_PLATFORM.basename?=      /usr/bin/basename
+TOOLS_PLATFORM.bzcat?=         /usr/bin/bzcat
+TOOLS_PLATFORM.cat?=           /bin/cat
+TOOLS_PLATFORM.bzip2?=         /usr/bin/bzip2
+TOOLS_PLATFORM.chgrp?=         /usr/bin/chgrp
+TOOLS_PLATFORM.chmod?=         /usr/bin/chmod
+TOOLS_PLATFORM.chown?=         /usr/bin/chown
+TOOLS_PLATFORM.cmp?=           /usr/bin/cmp
+TOOLS_PLATFORM.cp?=            /bin/cp 
+TOOLS_PLATFORM.cut?=           /usr/bin/cut
+TOOLS_PLATFORM.date?=          /bin/date
+TOOLS_PLATFORM.dirname?=       /usr/bin/dirname
+TOOLS_PLATFORM.echo?=          /bin/echo
+TOOLS_PLATFORM.env?=           /usr/bin/env
+TOOLS_PLATFORM.expr?=          /bin/expr
+TOOLS_PLATFORM.false?=         /bin/false
+TOOLS_PLATFORM.file?=          /usr/bin/file
+TOOLS_PLATFORM.find?=          /usr/bin/find
+TOOLS_PLATFORM.head?=          /usr/bin/head
+TOOLS_PLATFORM.id?=            /usr/bin/id
+TOOLS_PLATFORM.install?=       /bin/install
+TOOLS_PLATFORM.ln?=            /bin/ln
+TOOLS_PLATFORM.ls?=            /bin/ls
+TOOLS_PLATFORM.m4?=            /usr/bin/m4
+TOOLS_PLATFORM.mail?=          /usr/bin/mail
+TOOLS_PLATFORM.mkdir?=         /usr/bin/mkdir -p
+TOOLS_PLATFORM.mv?=            /bin/mv
+TOOLS_PLATFORM.nice?=          /usr/bin/nice
+TOOLS_PLATFORM.nroff?=         /usr/bin/nroff
+TOOLS_PLATFORM.pwd?=           /bin/pwd
+TOOLS_PLATFORM.rm?=            /bin/rm
+TOOLS_PLATFORM.rmdir?=         /bin/rmdir
+TOOLS_PLATFORM.sed?=   /bin/sed
+TOOLS_PLATFORM.sh?=            /bin/sh
+TOOLS_PLATFORM.sleep?=         /usr/bin/sleep
+TOOLS_PLATFORM.strip?=         /usr/bin/strip
+TOOLS_PLATFORM.tail?=          /usr/bin/tail
+TOOLS_PLATFORM.tar?=           /usr/bin/tar
+TOOLS_PLATFORM.bsdtar?=                /usr/bin/bsdtar
+TOOLS_PLATFORM.fetch?=         /usr/bin/fetch
+TOOLS_PLATFORM.tee?=           /usr/bin/tee
+TOOLS_PLATFORM.test?=          /bin/test
+TOOLS_PLATFORM.tr?=            /usr/bin/tr
+TOOLS_PLATFORM.true?=          /bin/true
+TOOLS_PLATFORM.tsort?=         /usr/bin/tsort
+TOOLS_PLATFORM.wc?=            /usr/bin/wc
+TOOLS_PLATFORM.xargs?=         /usr/bin/xargs
+TOOLS_PLATFORM.yacc?=          /usr/bin/yacc
+TOOLS_PLATFORM.grep?=          /usr/bin/grep
+TOOLS_PLATFORM.egrep?=         /usr/bin/egrep
+TOOLS_PLATFORM.fgrep?=         /usr/bin/fgrep
+TOOLS_PLATFORM.printf?=                /usr/bin/printf
+TOOLS_PLATFORM.touch?=         /usr/bin/touch
+TOOLS_PLATFORM.hostname?= /usr/bin/hostname
+TOOLS_PLATFORM.patch?=         /usr/bin/patch
+TOOLS_PLATFORM.diff?=  /usr/bin/diff
+TOOLS_PLATFORM.sort?=  /usr/bin/sort



Home | Main Index | Thread Index | Old Index