Last active
December 2, 2025 05:53
-
-
Save lidgnulinux/4b45bdaa4dab0c2248714090ad5abbc2 to your computer and use it in GitHub Desktop.
bsd.port.mk-inspired build for linux.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PREFIX=/usr | |
| LIBDIR=/usr/lib | |
| SYSCONFDIR=/etc | |
| LIBEXECDIR=/usr/libexec | |
| BINDIR=/usr/bin | |
| PACKAGE = ${PKGNAME}-${VERSION}-${REVISION}@${CATEGORIES} | |
| download: | |
| ifeq ($(SRCCD),archive) | |
| @echo "Mode: Archive" | |
| @if [ ! -f ${ARCHIVE} ]; then \ | |
| echo "File not found. Downloading ${ARCHIVE_FILE}..."; \ | |
| wget -c ${LINK}; \ | |
| else \ | |
| echo "Archive ${ARCHIVE} already exists. Skipping."; \ | |
| fi | |
| else ifeq ($(SRCCD),git) | |
| @echo "Mode: Git" | |
| @if [ ! -d ${PKGNAME} ]; then \ | |
| echo "Directory not found. Cloning git repo..."; \ | |
| git clone ${HOMEPAGE}; \ | |
| else \ | |
| echo "Git directory ${PKGNAME} already exists. Skipping."; \ | |
| fi | |
| else | |
| $(error Unknown SRCCD: ${SRCCD}. Valid options are 'archive' or 'git') | |
| endif | |
| extract: | |
| tar -xvf ${ARCHIVE} | |
| # prepare: | |
| # ${PREPARE} | |
| build: | |
| ifeq ($(BUILD),meson) | |
| @echo "Mode: Build Meson" | |
| meson setup -Dprefix=/usr -Dlibdir=/usr/lib ${BUILD_OPTION} build ${BUILDDIR} | |
| meson compile -C build | |
| else ifeq ($(BUILD),make) | |
| @echo "Mode: Build Make" | |
| ${AUTO_CONF} | |
| make -j4 -C ${BUILDDIR} PREFIX=${PREFIX} ${MAKEFLAGS} ${MAKEOPT} | |
| else ifeq ($(BUILD),cmake) | |
| @echo "Mode: Build Cmake" | |
| cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -B build -G Ninja -S ${BUILDDIR} ${BUILD_OPTION} | |
| cmake --build build | |
| else | |
| $(error Unknown BUILD: ${BUILD}. Valid options are 'meson', 'make', or 'cmake') | |
| endif | |
| package: | |
| ifeq ($(BUILD),meson) | |
| @echo "Mode: Package Meson" | |
| meson install --no-rebuild -C build --destdir package | |
| install -Dm644 $(PWD)/Makefile $(PWD)/build/package/var/lib/mk/${PACKAGE}.mk | |
| $(MAKE) post_build | |
| tar -C build/package -cvf ${PACKAGE}.tar.gz . | |
| else ifeq ($(BUILD),make) | |
| @echo "Mode: Package Make" | |
| ifeq ($(MKINST),no) | |
| @echo "No need to install" | |
| else | |
| make -j4 -C ${BUILDDIR} PREFIX=${PREFIX} ${MAKEFLAGS} ${MAKEOPT} DESTDIR="$(PWD)/package" install | |
| endif | |
| install -Dm644 $(PWD)/Makefile $(PWD)/package/var/lib/mk/${PACKAGE}.mk | |
| $(MAKE) post_build | |
| tar -C package -cvf ${PACKAGE}.tar.gz . | |
| else ifeq ($(BUILD),cmake) | |
| @echo "Mode: Package Cmake" | |
| DESTDIR="package" cmake --install build | |
| install -Dm644 $(PWD)/Makefile $(PWD)/package/var/lib/mk/${PACKAGE}.mk | |
| $(MAKE) post_build | |
| tar -C package -cvf ${PACKAGE}.tar.gz . | |
| else | |
| $(error Unknown BUILD: ${BUILD}. Valid options are 'meson', 'make', or 'cmake') | |
| endif | |
| install-package: | |
| echo "Installing package archive ${PKG}" | |
| echo "make directory for $(shell basename -s .tar.gz ${PKG})" | |
| mkdir /usr/pkg/$(shell basename -s .tar.gz ${PKG}) | |
| echo "extracting package archive ${PKG}" | |
| tar -xvf ${PKG} -C /usr/pkg/$(shell basename -s .tar.gz ${PKG}) | |
| graft -i -P -t / /usr/pkg/$(shell basename -s .tar.gz ${PKG}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| COMMENT = URL retrival utility and library | |
| VERSION = 8.17.0 | |
| REVISION = 0 | |
| CATEGORIES = net | |
| PKGNAME = curl | |
| HOMEPAGE = https://curl.se/ | |
| LINK = https://curl.se/download/curl-${VERSION}.tar.xz | |
| ARCHIVE = curl-${VERSION}.tar.xz | |
| SRCCD = archive | |
| BUILD = make | |
| BUILDDIR = curl-${VERSION} | |
| BUILD_OPTION = | |
| POST_BUILD = | |
| PREPARE = patch -p1 -d ${BUILDDIR} -i $(PWD)/reg-19408.patch; \ | |
| patch -p1 -d ${BUILDDIR} -i $(PWD)/reg-19383.patch | |
| AUTO_CONF = (cd ${BUILDDIR} && ./configure \ | |
| --prefix=/usr \ | |
| --libdir=/usr/lib \ | |
| --enable-static=yes \ | |
| --enable-shared=yes \ | |
| --enable-ipv6 \ | |
| --enable-pthreads \ | |
| --enable-threaded-resolver \ | |
| --with-ca-path=/etc/ssl/certs \ | |
| --without-libssh2 \ | |
| --with-openssl \ | |
| --with-libidn2) | |
| include lfs.port.mk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| COMMENT = Date and time library based on the C++11/14/17 <chrono> header | |
| VERSION = 3.0.4 | |
| REVISION = 0 | |
| CATEGORIES = libs | |
| PKGNAME = date | |
| HOMEPAGE = https://howardhinnant.github.io/date/date.html | |
| LINK = https://github.com/HowardHinnant/date/archive/v3.0.4/date-v3.0.4.tar.gz | |
| ARCHIVE = ${PKGNAME}-v${VERSION}.tar.gz | |
| SRCCD = archive | |
| BUILD = cmake | |
| BUILDDIR = date-${VERSION} | |
| BUILD_OPTION = -DCMAKE_BUILD_TYPE=None \ | |
| -DCMAKE_INSTALL_PREFIX=/usr \ | |
| -DCMAKE_INSTALL_LIBDIR=lib \ | |
| -DBUILD_SHARED_LIBS=true \ | |
| -DBUILD_TZ_LIB=true \ | |
| -DUSE_SYSTEM_TZ_DB=true \ | |
| -DENABLE_DATE_TESTING=true \ | |
| -Wno-dev | |
| include lfs.port.mk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| COMMENT = dwm for wayland | |
| VERSION = v0.8-dev | |
| REVISION = 0 | |
| CATEGORIES = wayland | |
| PKGNAME = dwl | |
| HOMEPAGE = https://codeberg.org/dwl/dwl | |
| LINK = ${HOMEPAGE} | |
| SRCCD = git | |
| BUILD = make | |
| BUILDDIR = dwl | |
| BUILD_OPTION = | |
| include lfs.port.mk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| COMMENT = xdotool type for wayland | |
| VERSION = 0.4 | |
| REVISION = 0 | |
| CATEGORIES = wayland | |
| PKGNAME = wtype | |
| HOMEPAGE = https://github.com/atx/wtype | |
| LINK = ${HOMEPAGE}/archive/v${VERSION}/wtype-${VERSION}.tar.gz | |
| ARCHIVE = wtype-${VERSION}.tar.gz | |
| SRCCD = archive | |
| BUILD = meson | |
| BUILDDIR = wtype-0.4 | |
| BUILD_OPTION = --prefix=${PREFIX} \ | |
| --libdir=${LIBDIR} \ | |
| --buildtype=release | |
| include lfs.port.mk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment