ports_rebrand.sh 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #!/bin/ksh
  2. #########################
  3. # Name: ports_rebrand.sh
  4. # Main: jadedctrl
  5. # Lisc: ISC # Desc: Editing OBSD ports
  6. # tree for use with
  7. # LBSD.
  8. #########################
  9. # Usage: ports_deblob.sh
  10. . ./libdeblob.sh
  11. PATCH_DIR=/tmp/ports_rebrand/
  12. if [ -e $PATCH_DIR ]
  13. then
  14. self_destruct_sequence $PATCH_DIR
  15. mkdir $PATCH_DIR
  16. else
  17. mkdir $PATCH_DIR
  18. fi
  19. if test -z $1
  20. then
  21. SRC_DIR=/usr/ports/
  22. else
  23. SRC_DIR=$1
  24. fi
  25. . ./files/ports/aliafy.sh
  26. # Add the build_alias env variable to listed ports
  27. for port in $portlist
  28. do
  29. rep ".include <bsd.port.mk>" "CONFIGURE_ENV += build_alias=\"\${ARCH}-unknown-openbsd6.1\"" $port/Makefile
  30. lineadd "CONFIGURE_ENV += build_alias=\"\${ARCH}-unknown-openbsd6.1\"" ".include <bsd.port.mk>" $port/Makefile
  31. done
  32. . ./files/ports/caliafy.sh
  33. # Add the -DCMAKE_SYSTEM_NAME argument to listed ports
  34. for port in $portlist
  35. do
  36. rep ".include <bsd.port.mk>" "CONFIGURE_ARGS += -DCMAKE_SYSTEM_NAME=OpenBSD" $port/Makefile
  37. lineadd "CONFIGURE_ARGS += -DCMAKE_SYSTEM_NAME=OpenBSD" ".include <bsd.port.mk>" $port/Makefile
  38. done
  39. # Port-specific changes for build
  40. rep ".include <bsd.port.mk>" "CONFIGURE_ENV += build_alias=\"\${ARCH}-unknown-openbsd\"" lang/ghc/Makefile
  41. lineadd "CONFIGURE_ENV += build_alias=\"\${ARCH}-unknown-openbsd\"" ".include <bsd.port.mk>" lang/ghc/Makefile
  42. lineadd "pre-configure:" " @cp \${FILESDIR}/Platform/LibertyBSD.cmake \${WRKSRC}/Modules/Platform/LibertyBSD.cmake" devel/cmake/Makefile
  43. lineadd "\${WRKSRC}/config" " @cp \${FILESDIR}/Makefile.openbsd ${WRKSRC}/config/Makefile.libertybsd" graphics/glew/Makefile
  44. dircp files/ports/files/cmake/Platform devel/cmake/files/Platform
  45. lineadd "pre-configure:" " @cp \${FILESDIR}/platforms/LibertyBSD.cmake \${WRKSRC}/cmake/platforms/LibertyBSD.cmake" devel/llvm/Makefile
  46. dircp files/ports/files/llvm/ devel/llvm/files/
  47. rep "-no-ssse3 -no-sse3" "-no-ssse3 -no-sse3 -platform openbsd-g++" x11/qt5/qtbase/Makefile
  48. rep "--enable-shared" "--enable-shared --target-os=openbsd" graphics/ffmpeg/Makefile
  49. # *.mk edits
  50. rep "\${MACHINE-ARCH}-openbsd" "\${MACHINE-ARCH}-libertybsd" infrastructure/mk/perl.port.mk
  51. # Misc. infrastructure edits
  52. lineadd "*:OpenBSD:*:*)" "*:LibertyBSD:*:*)" infrastructure/db/config.guess
  53. lineadd "*:OpenBSD:*:*)" " exit ;;" infrastructure/db/config.guess
  54. lineadd "*:OpenBSD:*:*)" " echo \${UNAME_MACHINE_ARCH}-unknown-openbsd\${UNAME_RELEASE}" infrastructure/db/config.guess
  55. lineadd "*:OpenBSD:*:*)" " UNAME_MACHINE_ARCH=\`arch | sed 's/^.*BSD\.//'\`" infrastructure/db/config.guess
  56. # Go through ports with additional patches for LBSD
  57. for category in files/ports/files/patches/*
  58. do
  59. category_name="$(echo $category | sed 's^.*/^^')"
  60. for port in $category
  61. do
  62. port_name="$(echo $port | sed 's^.*/^^')"
  63. for patch in $port
  64. do
  65. patch_name="$(echo $patch | sed 's^.*/^^')"
  66. filecp "files/ports/file/patches/$category_name/$port_name/$patch_name" "$category_name/$port_name/patches/$patch_name"
  67. done
  68. done
  69. done
  70. # Port-specific changes for rebranding
  71. rep "ftp.openbsd.org/pub/OpenBSD/snapshots/i386/cd52.iso" "ftp.libertybsd.net/pub/LibertyBSD/snapshots/i386/cd61.iso" emulators/qemu/pkg/README
  72. rep "ftp.openbsd.org/pub/OpenBSD/snapshots/amd64/cd52.iso" "ftp.libertybsd.net/pub/LibertyBSD/snapshots/amd64/cd61.iso" emulators/qemu/pkg/README
  73. linedel "\$ ftp ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/sparc/cd52.iso" emulators/qemu/pkg/README
  74. rep "install52.fs" "install61.fs" emulators/qemu/pkg/README
  75. rep "install52.iso" "install61.iso" emulators/qemu/pkg/README
  76. rep "OpenBSD" "LibertyBSD" emulators/qemu/pkg/README
  77. rep "ftp.openbsd.org" "ftp.libertybsd.net" sysutils/ruby-puppet/4/patches/patch-lib_puppet_provider_package-openbsd_rb
  78. rep "on OpenBSD" "on LibertyBSD" sysutils/sysmon/pkg/README ; rep "openbsd.org" "libertybsd.net" sysutils/sysmon/pkg/README
  79. rep "=\"OpenBSD " "=\"LibertyBSD " multimedia/gstreamer-0.10/Makefile.inc
  80. rep "openbsd.org" "libertybsd.net" multimedia/gstreamer-0.10/Makefile.inc
  81. # @jimmybot for this :) ^^
  82. rep "www.openbsd.org" "libertybsd.net" www/lynx/patches/patch-lynx_cfg
  83. apply