diff --git a/.gitignore b/.gitignore index 0adf591c..dde6add8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ build builddir __pycache__ .vscode -MangoHud*.tar.gz +MangoHud*.tar.* pkg mangohud*.tar.* lib32-mangohud*.tar.* @@ -44,4 +44,4 @@ subprojects/imgui-*/ #GNU Global Metadata **/GPATH **/GRTAGS -**/GTAGS \ No newline at end of file +**/GTAGS diff --git a/build-source.sh b/build-source.sh index 5636d594..d5b4ff6b 100755 --- a/build-source.sh +++ b/build-source.sh @@ -1,15 +1,36 @@ #!/bin/sh VERSION=$(git describe --tags --dirty) -NAME=MangoHud-$VERSION-Source - -# create archive via git -git archive HEAD --format=tar --prefix=${NAME}/ --output=${NAME}.tar -# remove unused minihook from source tarball -tar -f ${NAME}.tar --delete ${NAME}/modules -# create DFSG compliant version which excludes NVML -cp ${NAME}.tar ${NAME}-DFSG.tar -tar -f ${NAME}-DFSG.tar --delete ${NAME}/include/nvml.h -# compress archives -gzip ${NAME}.tar -gzip ${NAME}-DFSG.tar +NAME=MangoHud-${VERSION} +TAR_NAME=${NAME}-Source.tar.xz +DFSG_TAR_NAME=${NAME}-Source-DFSG.tar.xz + +# remove existing files +rm -rf sourcedir +rm -rf ${NAME} +rm -f ${TAR_NAME} +rm -f ${DFSG_TAR_NAME} + +# create tarball with meson +meson sourcedir +meson dist --formats=xztar --include-subprojects --no-tests -C sourcedir +mv sourcedir/meson-dist/*.tar.xz ${TAR_NAME} + +# create DFSG compliant version +# unpack since tarball is compressed +mkdir ${NAME} +tar -xf ${TAR_NAME} --strip 1 -C ${NAME} +# nvml.h is not DFSG compliant +rm ${NAME}/include/nvml.h +# minhook not needed +rm -r ${NAME}/modules/minhook +# vulkan headers from system +rm -r ${NAME}/subprojects/Vulkan-Headers-* +# remove some dear imgui clutter +rm -rf ${NAME}/subprojects/imgui-*/examples ${NAME}/subprojects/imgui-*/misc +# compress new sources +tar -cJf ${DFSG_TAR_NAME} ${NAME} + +# cleanup +rm -r sourcedir +rm -r ${NAME} diff --git a/meson.build b/meson.build index f9a43ed5..838c3773 100644 --- a/meson.build +++ b/meson.build @@ -216,8 +216,24 @@ elif sizeof_ptr == 4 pre_args += '-DMANGOHUD_ARCH="32bit"' endif -dearimgui_sp = subproject('imgui') -dearimgui_dep = dearimgui_sp.get_variable('dearimgui_dep') +dearimgui_sp = subproject('imgui', default_options: [ + 'default_library=static', + # use 'auto_features=disabled' once available: https://github.com/mesonbuild/meson/issues/5320 + 'dx9=disabled', + 'dx10=disabled', + 'dx11=disabled', + 'dx12=disabled', + 'metal=disabled', + 'opengl=disabled', + 'vulkan=disabled', + 'glfw=disabled', + 'sdl2=disabled', + 'osx=disabled', + 'win=disabled', + 'marmalade=disabled', + 'allegro5=disabled', +]) +dearimgui_dep = dearimgui_sp.get_variable('imgui_dep') if ['windows', 'mingw'].contains(host_machine.system()) subdir('modules/minhook') diff --git a/subprojects/imgui.wrap b/subprojects/imgui.wrap index 1cee5883..873e7268 100644 --- a/subprojects/imgui.wrap +++ b/subprojects/imgui.wrap @@ -1,7 +1,11 @@ -[wrap-git] -directory = imgui -url = https://github.com/ocornut/imgui.git -revision = 22ace4438c86b3137567c69346a3836d26ebf95c -patch_url = https://flightlessmango.com/wraps/imgui.zip -patch_filename = imgui.zip -patch_hash = 55e9f31b3edfe725e7271bd0dd06434ba2a3b6fdce476314947907a43e36b641 \ No newline at end of file +[wrap-file] +directory = imgui-1.80 +source_url = https://github.com/ocornut/imgui/archive/v1.80.tar.gz +source_filename = imgui-1.80.tar.gz +source_hash = d7e4e1c7233409018437a646680316040e6977b9a635c02da93d172baad94ce9 +patch_url = https://wrapdb.mesonbuild.com/v1/projects/imgui/1.80/1/get_zip +patch_filename = imgui-1.80-1-wrap.zip +patch_hash = 9b86a584968d3c4b0b0c0cd648013eb5b81aeb6789babe3c1097727a134efc7f + +[provide] +imgui = imgui_dep