diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..ef7faca Binary files /dev/null and b/.DS_Store differ diff --git a/assets/mxl-on-blue-square.png b/assets/mxl-on-blue-square.png new file mode 100644 index 0000000..d91733e Binary files /dev/null and b/assets/mxl-on-blue-square.png differ diff --git a/assets/mxl-on-blue-square.svg b/assets/mxl-on-blue-square.svg new file mode 100644 index 0000000..8e7a2a9 --- /dev/null +++ b/assets/mxl-on-blue-square.svg @@ -0,0 +1,104 @@ + + + + diff --git a/build-mac-app.sh b/build-mac-app.sh new file mode 100755 index 0000000..722378e --- /dev/null +++ b/build-mac-app.sh @@ -0,0 +1,123 @@ +#!/bin/bash +set -euo pipefail + +# ELF building +export MXL_SOURCE=/Users/jitten/extra/mxl +export MXL_BUILD="${MXL_SOURCE}/build/Darwin-Clang-Release" + +WORK_DIR="$(mktemp -d)" +trap 'rm -rf "${WORK_DIR}"' EXIT + +# libmxl.pc in the build tree hardcodes the install/ prefix; rewrite it so +# cgo's pkg-config lookup gets the build tree's lib/include dirs. +sed -e "s|${MXL_SOURCE}/install|${MXL_SOURCE}/build|g" \ + -e "s|^includedir=.*|includedir=${MXL_BUILD}/lib/include|" \ + "${MXL_BUILD}/lib/libmxl.pc" > "${WORK_DIR}/libmxl.pc" +export PKG_CONFIG_PATH="${WORK_DIR}:${MXL_BUILD}/lib${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" +export CGO_CFLAGS="-I${MXL_SOURCE}/lib/include" +export CGO_LDFLAGS="-L${MXL_BUILD}/lib" + +PLAYER_ELF_PATH="./build/mxl-player" +go build \ + -trimpath \ + -ldflags="-s -w" \ + -o "${PLAYER_ELF_PATH}" \ + ./cmd/mxl-player + +# MacOS .app package +export APP_BUNDLE="./release/mac/MXL-player.app" +rm -rf "${APP_BUNDLE}" +mkdir -p "${APP_BUNDLE}/Contents/MacOS" +mkdir -p "${APP_BUNDLE}/Contents/Frameworks" +mkdir -p "${APP_BUNDLE}/Contents/Resources" + +cp "${PLAYER_ELF_PATH}" "${APP_BUNDLE}/Contents/MacOS/mxl-player" +chmod 0755 "${APP_BUNDLE}/Contents/MacOS/mxl-player" + +# App icon +ICONSET="${WORK_DIR}/MXL-player.iconset" +mkdir -p "${ICONSET}" +for s in 16 32 128 256 512; do + sips -z $s $s ./assets/mxl-on-blue-square.png \ + --out "${ICONSET}/icon_${s}x${s}.png" > /dev/null + sips -z $((s*2)) $((s*2)) ./assets/mxl-on-blue-square.png \ + --out "${ICONSET}/icon_${s}x${s}@2x.png" > /dev/null +done +iconutil -c icns "${ICONSET}" \ + -o "${APP_BUNDLE}/Contents/Resources/AppIcon.icns" + +# Info.plist +cat << EOF > "${APP_BUNDLE}/Contents/Info.plist" + + + + + CFBundleName + MXL Player + + CFBundleDisplayName + MXL Player + + CFBundleIdentifier + io.github.jitten.mxl-player + + CFBundleExecutable + mxl-player + + CFBundlePackageType + APPL + + CFBundleShortVersionString + 0.1.0 + + CFBundleVersion + 1 + + LSMinimumSystemVersion + 13.0 + + NSHighResolutionCapable + + + LSApplicationCategoryType + public.app-category.video + + CFBundleIconFile + AppIcon + + +EOF +plutil -lint "${APP_BUNDLE}/Contents/Info.plist" + +# copy runtime libs (install IDs must stay untouched: libmxl is already +# @rpath/libmxl.1.dylib from the build tree; SDL3/MoltenVK are dlopen'ed by +# leaf name, so their IDs are never referenced) +cp -L "${MXL_BUILD}/lib/libmxl.1.dylib" \ + "${APP_BUNDLE}/Contents/Frameworks/libmxl.1.dylib" +cp -L "$(brew --prefix sdl3)/lib/libSDL3.0.dylib" \ + "${APP_BUNDLE}/Contents/Frameworks/libSDL3.0.dylib" +cp -L "$(brew --prefix molten-vk)/lib/libMoltenVK.dylib" \ + "${APP_BUNDLE}/Contents/Frameworks/libMoltenVK.dylib" + +# resolve @rpath/libmxl.1.dylib and the dlopen'ed SDL3/MoltenVK leaf names +# against the bundle's Frameworks dir +install_name_tool \ + -add_rpath "@loader_path/../Frameworks" \ + "${APP_BUNDLE}/Contents/MacOS/mxl-player" + +# install_name_tool invalidated the executable's ad-hoc signature; re-sign +codesign --force --sign - "${APP_BUNDLE}" +codesign --verify "${APP_BUNDLE}" + +env -u SDL3_LIBRARY \ + -u VULKAN_LIBRARY \ + -u DYLD_LIBRARY_PATH \ + "${APP_BUNDLE}/Contents/MacOS/mxl-player" + +# compress, preserve MacOS bundle meta +ditto -c -k \ + --sequesterRsrc \ + --keepParent \ + "${APP_BUNDLE}" \ + ./release/mac/mxl-player-0.1.0-macos-arm64.zip diff --git a/cmd/.DS_Store b/cmd/.DS_Store new file mode 100644 index 0000000..6e10123 Binary files /dev/null and b/cmd/.DS_Store differ diff --git a/imgui.ini b/imgui.ini index 9639166..ce6c77c 100644 --- a/imgui.ini +++ b/imgui.ini @@ -5,7 +5,7 @@ Collapsed=0 [Window][Settings & Info] Pos=0,0 -Size=700,1080 +Size=700,804 Collapsed=0 [Window][Stats] diff --git a/release/.DS_Store b/release/.DS_Store new file mode 100644 index 0000000..0ad0aee Binary files /dev/null and b/release/.DS_Store differ diff --git a/release/mac/.DS_Store b/release/mac/.DS_Store new file mode 100644 index 0000000..d134574 Binary files /dev/null and b/release/mac/.DS_Store differ diff --git a/release/mac/MXL-player.app/Contents/Frameworks/libMoltenVK.dylib b/release/mac/MXL-player.app/Contents/Frameworks/libMoltenVK.dylib new file mode 100644 index 0000000..18a393f Binary files /dev/null and b/release/mac/MXL-player.app/Contents/Frameworks/libMoltenVK.dylib differ diff --git a/release/mac/MXL-player.app/Contents/Frameworks/libSDL3.0.dylib b/release/mac/MXL-player.app/Contents/Frameworks/libSDL3.0.dylib new file mode 100644 index 0000000..ad41ccb Binary files /dev/null and b/release/mac/MXL-player.app/Contents/Frameworks/libSDL3.0.dylib differ diff --git a/release/mac/MXL-player.app/Contents/Frameworks/libmxl.1.dylib b/release/mac/MXL-player.app/Contents/Frameworks/libmxl.1.dylib new file mode 100755 index 0000000..bfea18d Binary files /dev/null and b/release/mac/MXL-player.app/Contents/Frameworks/libmxl.1.dylib differ diff --git a/release/mac/MXL-player.app/Contents/Info.plist b/release/mac/MXL-player.app/Contents/Info.plist new file mode 100644 index 0000000..7493a53 --- /dev/null +++ b/release/mac/MXL-player.app/Contents/Info.plist @@ -0,0 +1,39 @@ + + + + + CFBundleName + MXL Player + + CFBundleDisplayName + MXL Player + + CFBundleIdentifier + io.github.jitten.mxl-player + + CFBundleExecutable + mxl-player + + CFBundlePackageType + APPL + + CFBundleShortVersionString + 0.1.0 + + CFBundleVersion + 1 + + LSMinimumSystemVersion + 13.0 + + NSHighResolutionCapable + + + LSApplicationCategoryType + public.app-category.video + + CFBundleIconFile + AppIcon + + diff --git a/release/mac/MXL-player.app/Contents/MacOS/mxl-player b/release/mac/MXL-player.app/Contents/MacOS/mxl-player new file mode 100755 index 0000000..8fc1516 Binary files /dev/null and b/release/mac/MXL-player.app/Contents/MacOS/mxl-player differ diff --git a/release/mac/MXL-player.app/Contents/Resources/AppIcon.icns b/release/mac/MXL-player.app/Contents/Resources/AppIcon.icns new file mode 100644 index 0000000..8879941 Binary files /dev/null and b/release/mac/MXL-player.app/Contents/Resources/AppIcon.icns differ diff --git a/release/mac/MXL-player.app/Contents/_CodeSignature/CodeResources b/release/mac/MXL-player.app/Contents/_CodeSignature/CodeResources new file mode 100644 index 0000000..42c423b --- /dev/null +++ b/release/mac/MXL-player.app/Contents/_CodeSignature/CodeResources @@ -0,0 +1,155 @@ + + + + + files + + Resources/AppIcon.icns + + aOS6hffTaTtxQc0zhZI1xOsNz0I= + + + files2 + + Frameworks/libMoltenVK.dylib + + cdhash + + ETd5I/t5G4xenebaPwHV0Q99lls= + + requirement + cdhash H"11377923fb791b8c5e9de6da3f01d5d10f7d965b" + + Frameworks/libSDL3.0.dylib + + cdhash + + NNHvv93cCnUaCS7Jl7MJkRtCOKs= + + requirement + cdhash H"34d1efbfdddc0a751a092ec997b309911b4238ab" + + Frameworks/libmxl.1.dylib + + cdhash + + MbqPNJYzYRFJ+VJyBwbTvnpRM0M= + + requirement + cdhash H"31ba8f349633611149f952720706d3be7a513343" + + Resources/AppIcon.icns + + hash2 + + 30ycN9D9rWpkLESaFOwycI8ufPkx8qO20cW46sVar2Q= + + + + rules + + ^Resources/ + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^Resources/ + + weight + 20 + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/release/mac/mxl-player-0.1.0-macos-arm64.zip b/release/mac/mxl-player-0.1.0-macos-arm64.zip new file mode 100644 index 0000000..736d58c Binary files /dev/null and b/release/mac/mxl-player-0.1.0-macos-arm64.zip differ