From 12a3de04fa1ff40228533a69a5ac60d905a33f9e Mon Sep 17 00:00:00 2001 From: topazus Date: Nov 18 2023 12:25:05 +0000 Subject: initial import (rhbz#2249796) --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5140cc6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/xmake-*.tar.gz diff --git a/0001-add-relwithdebinfo-build-mode.patch b/0001-add-relwithdebinfo-build-mode.patch new file mode 100644 index 0000000..1d2d7e5 --- /dev/null +++ b/0001-add-relwithdebinfo-build-mode.patch @@ -0,0 +1,14 @@ +diff --git a/core/xmake.sh b/core/xmake.sh +index b21e34efe..69b2b3c3e 100755 +--- a/core/xmake.sh ++++ b/core/xmake.sh +@@ -21,6 +21,9 @@ fi + if is_mode "debug"; then + set_symbols "debug" + set_optimizes "none" ++elif is_mode "relwithdebinfo"; then ++ set_symbols "debug" ++ set_optimizes "faster" # -O2 + else + set_strip "all" + if ! is_kind "shared"; then diff --git a/0001-pkgconfig-fix-check.patch b/0001-pkgconfig-fix-check.patch new file mode 100644 index 0000000..094b76e --- /dev/null +++ b/0001-pkgconfig-fix-check.patch @@ -0,0 +1,31 @@ +diff --git a/core/xmake.sh b/core/xmake.sh +index b21e34efe..f391618de 100755 +--- a/core/xmake.sh ++++ b/core/xmake.sh +@@ -87,13 +87,13 @@ option_find_lua() { + local ldflags="" + local cflags="" + option "lua" +- cflags=`pkg-config --cflags lua5.4 2>/dev/null` +- ldflags=`pkg-config --libs lua5.4 2>/dev/null` ++ cflags=`pkg-config --cflags lua 2>/dev/null` ++ ldflags=`pkg-config --libs lua 2>/dev/null` + if test_z "${cflags}"; then +- cflags="-I/usr/include/lua5.4" ++ cflags="-I/usr/include" + fi + if test_z "${ldflags}"; then +- ldflags="-llua5.4" ++ ldflags="-llua" + fi + add_cflags "${cflags}" + add_ldflags "${ldflags}" +@@ -152,7 +152,7 @@ option_find_lz4() { + # the sv option + option "sv" + add_cfuncs "semver_tryn" +- add_cincludes "semver.h" ++ add_cincludes "sv/semver.h" + add_links "sv" + before_check "option_find_sv" + option_end diff --git a/0001-system-include.patch b/0001-system-include.patch new file mode 100644 index 0000000..2d89037 --- /dev/null +++ b/0001-system-include.patch @@ -0,0 +1,26 @@ +diff --git a/core/src/xmake/hash/xxhash.c b/core/src/xmake/hash/xxhash.c +index 9901f58f6..ef523c2d9 100644 +--- a/core/src/xmake/hash/xxhash.c ++++ b/core/src/xmake/hash/xxhash.c +@@ -32,7 +32,7 @@ + #define XXH_NAMESPACE XM_ + #define XXH_STATIC_LINKING_ONLY + #define XXH_IMPLEMENTATION +-#include "xxhash/xxhash.h" ++#include "xxhash.h" + + /* ////////////////////////////////////////////////////////////////////////////////////// + * implementation +diff --git a/core/src/xmake/semver/prefix.h b/core/src/xmake/semver/prefix.h +index 2112d73f1..9077b49ca 100644 +--- a/core/src/xmake/semver/prefix.h ++++ b/core/src/xmake/semver/prefix.h +@@ -25,7 +25,7 @@ + * includes + */ + #include "../prefix.h" +-#include "semver.h" ++#include "sv/semver.h" + + /* ////////////////////////////////////////////////////////////////////////////////////// + * extern diff --git a/sources b/sources new file mode 100644 index 0000000..7e9e1e5 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (xmake-2.8.5.tar.gz) = e5333a99d8580e4b69731c6efe0d613c65e57676443503b5caa6059f747382376ed2760e7959eec790d43d72a314e1b3975b0beaf8f9277f845b58b3a4faab6c diff --git a/xmake.spec b/xmake.spec new file mode 100644 index 0000000..3c0d906 --- /dev/null +++ b/xmake.spec @@ -0,0 +1,118 @@ +%bcond_with luajit + +Name: xmake +Version: 2.8.5 + +%global forgeurl https://github.com/xmake-io/xmake + +%forgemeta + +Release: %autorelease +Summary: A cross-platform build utility based on Lua + +License: Apache-2.0 +URL: https://xmake.io +Source: %forgesource + +Patch0: 0001-pkgconfig-fix-check.patch +Patch1: 0001-system-include.patch +Patch2: 0001-add-relwithdebinfo-build-mode.patch + +BuildRequires: pkgconfig(ncurses) +BuildRequires: pkgconfig(readline) +BuildRequires: pkgconfig(liblz4) +BuildRequires: pkgconfig(libxxhash) +BuildRequires: pkgconfig(libtbox) +BuildRequires: pkgconfig(libsv) +%if %{with luajit} +BuildRequires: pkgconfig(luajit) +%else +BuildRequires: pkgconfig(lua) >= 5.4 +%endif +BuildRequires: pkgconfig(libtbox) + +BuildRequires: bash +BuildRequires: sed +BuildRequires: make +BuildRequires: gcc +BuildRequires: gcc-c++ + +Requires: %{name}-data = %{version}-%{release} + +%description +xmake is a lightweight cross-platform build utility based on Lua. + +It uses xmake.lua to maintain project builds. Compared with +makefile/CMakeLists.txt, the configuration syntax is more concise and +intuitive. It is very friendly to novices and can quickly get started in +a short time. Let users focus more on actual project development. + +It can compile the project directly like Make/Ninja, or generate project +files like CMake/Meson, and it also has a built-in package management +system to help users solve the integrated use of C/C++ dependent +libraries. + +%package data +Summary: Common data-files for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description data +This package contains common data-files for %{name}. + +%prep +%forgeautosetup -p1 + +# Cleanup bundled deps +rm -rf core/src/{lua,luajit,lua-cjson,lz4,pdcurses,sv,tbox,xxhash}/*/ + +# Fix shebang since the configure script is not strictly POSIX sh +# and relies on bash-specific behavior +sed -i '1 s|#!/bin/sh|#!/bin/bash|' %{_configure} + +%build +%configure --external=yes --mode=relwithdebinfo \ +%if %{with luajit} + --runtime=luajit +%else + --runtime=lua +%endif + +%make_build + +%install +mkdir -p %{buildroot}%{_mandir}/man1/ +install -Dpm0755 build/xmake \ + %{buildroot}%{_bindir}/%{name} +install -Dpm0755 scripts/xrepo.sh \ + %{buildroot}%{_bindir}/xrepo +install -Dpm0644 scripts/man/*1 \ + %{buildroot}%{_mandir}/man1/ +install -Dpm0644 xmake/scripts/completions/register-completions.bash \ + %{buildroot}%{bash_completions_dir}/%{name} +install -Dpm0644 xmake/scripts/completions/register-completions.fish \ + %{buildroot}%{fish_completions_dir}/%{name}.fish +install -Dpm0644 xmake/scripts/completions/register-completions.zsh \ + %{buildroot}%{zsh_completions_dir}/_%{name} +cp -rp xmake \ + %{buildroot}%{_datadir}/%{name} + +%check +%{buildroot}%{_bindir}/%{name} --version +%{buildroot}%{_bindir}/xrepo --version + +%files +%doc README.md CHANGELOG.md +%license LICENSE.md NOTICE.md +%{_bindir}/%{name} +%{_bindir}/xrepo +%{bash_completions_dir}/%{name} +%{zsh_completions_dir}/_%{name} +%{fish_completions_dir}/%{name}.fish +%{_mandir}/man1/*.1* + +%files data +%{_datadir}/%{name} + +%changelog +%autochangelog