diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000000..4fb5ff37a48a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,265 @@ +name: build + +on: + push: + tags: + - 'v*.*.*' + +jobs: + +# ============================= +# Create release +# ============================= + +# Create release, but only if it's triggered by tag push. +# On pull requests/commits push, this job will always complete. + + maybe-release: + runs-on: ubuntu-latest + steps: + - name: Clone project + if: startsWith(github.ref, 'refs/tags/v') + uses: actions/checkout@v3 + + - name: Build changelog + id: build_changelog + if: startsWith(github.ref, 'refs/tags/v') + uses: simplex-chat/release-changelog-builder-action@v5 + with: + configuration: .github/changelog_conf.json + failOnError: true + ignorePreReleases: true + commitMode: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create release + if: startsWith(github.ref, 'refs/tags/v') + uses: simplex-chat/action-gh-release@v2 + with: + body: ${{ steps.build_changelog.outputs.changelog }} + prerelease: true + files: | + COPYING + fail_on_unmatched_files: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +# ========================= +# Linux Build +# ========================= + + build-linux: + name: "ubuntu-${{ matrix.os }}" + needs: maybe-release + runs-on: ubuntu-${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: 22.04 + arch: x86_64 + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: simplex-chat/docker-setup-buildx-action@v3 + + # Otherwise we run out of disk space with Docker build + - name: Free disk space + shell: bash + run: ./.github/workflows/linux_util_free_space.sh + + - name: Start container + shell: bash + run: | + docker run -t -d \ + --device /dev/fuse \ + --cap-add SYS_ADMIN \ + --security-opt apparmor:unconfined \ + --name builder \ + -v /home/runner/work/_temp:/home/runner/work/_temp \ + -v ${{ github.workspace }}:/project \ + debian:stable + + - name: Build CLI + shell: docker exec -t builder sh -eu {0} + run: | + echo "deb-src http://deb.debian.org/debian stable main" >> /etc/apt/sources.list + export TZ='Etc/UTC' DEBIAN_FRONTEND=noninteractive + apt update && apt upgrade -y + + apt build-dep -y vlc + apt install -y git curl zip libtool automake autoconf autopoint make \ + gettext pkg-config subversion cmake cvs zip bzip2 patchelf \ + p7zip-full wget dos2unix ragel yasm g++ protobuf-compiler \ + m4 ant build-essential libtool-bin libavformat-dev fuse \ + libswresample-dev libavutil-dev libpostproc-dev libswscale-dev \ + wayland-protocols qtbase5-private-dev libarchive-dev libmpg123-dev \ + libnfs-dev libqt5svg5-dev flex bison curl qtdeclarative5-dev \ + qtquickcontrols2-5-dev nasm gcovr libxkbcommon-x11-dev meson || : + apt-get clean -y && rm -rf /var/lib/apt/lists/* + + chmod -R 777 /project && git config --global --add safe.directory '*' + + cd /project + + ./bootstrap &&\ + ./configure --prefix="/usr" &&\ + make -j"$(nproc)" &&\ + make -j"$(nproc)" DESTDIR=$(pwd)/build/ install + + rm /project/build/usr/lib/vlc/plugins/plugins.dat + + find /project/build/usr/lib/vlc/ -maxdepth 1 -name "lib*.so*" -exec patchelf --set-rpath '$ORIGIN/../' {} \; + find /project/build/usr/lib/vlc/plugins/ -name "lib*.so*" -exec patchelf --set-rpath '$ORIGIN/../../:$ORIGIN/../../../' {} \; + + curl -LO 'https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage' &&\ + + chmod a+x linuxdeployqt-continuous-x86_64.AppImage + + # linuxdeployqt workaround + mkdir -p /project/build/usr/share/doc/libc6 &&\ + touch /project/build/usr/share/doc/libc6/copyright + + ./linuxdeployqt-continuous-x86_64.AppImage /project/build/usr/share/applications/vlc.desktop -appimage -unsupported-allow-new-glibc -bundle-non-qt-libs -exclude-libs=libfreetype.so.6 + + mv VLC_media_player-*.AppImage vlc-linux-${{ matrix.arch }}.appimage && chmod 777 vlc-linux-${{ matrix.arch }}.appimage + + - name: Upload binaries + uses: simplex-chat/action-gh-release@v2 + with: + append_body: true + fail_on_unmatched_files: true + files: ./vlc-linux-${{ matrix.arch }}.appimage + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +# ========================= +# MacOS Build +# ========================= + + build-macos: + name: "${{ matrix.os }}" + needs: maybe-release + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: macos-latest + brew: /opt/homebrew + arch: aarch64 + - os: macos-13 + brew: /usr/local + arch: x86_64 + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Install tools + shell: bash + run: | + brew install coreutils openjdk@11 + sudo ln -sfn ${{ matrix.brew }}/opt/openjdk@11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-11.jdk + + - name: Build + shell: bash + run: | + export JAVA_HOME=$(/usr/libexec/java_home -v 11) + + mkdir build + cd build + ../extras/package/macosx/build.sh -c -a ${{ matrix.arch }} -i u || + ../extras/package/macosx/build.sh -c -a ${{ matrix.arch }} -i u || + ../extras/package/macosx/build.sh -c -a ${{ matrix.arch }} -i u + + unzip -oqq vlc-*-release.zip && cd vlc-*-release + zip -r "vlc-macos-${{ matrix.arch }}.zip" . && mv "vlc-macos-${{ matrix.arch }}.zip" .. + + - name: Upload binaries + uses: simplex-chat/action-gh-release@v2 + with: + append_body: true + fail_on_unmatched_files: true + files: ./build/vlc-macos-${{ matrix.arch }}.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +# ========================= +# Windows Build +# ========================= + + build-windows: + name: "Windows" + needs: maybe-release + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + arch: x86_64 + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: simplex-chat/docker-setup-buildx-action@v3 + + # Otherwise we run out of disk space with Docker build + - name: Free disk space + shell: bash + run: ./.github/workflows/linux_util_free_space.sh + + - name: Start container + shell: bash + run: | + docker run -t -d \ + --device /dev/fuse \ + --cap-add SYS_ADMIN \ + --security-opt apparmor:unconfined \ + --name builder \ + -v /home/runner/work/_temp:/home/runner/work/_temp \ + -v ${{ github.workspace }}:/project \ + ubuntu:latest + + - name: Build CLI + shell: docker exec -t builder sh -eu {0} + run: | + export TZ='Etc/UTC' DEBIAN_FRONTEND=noninteractive + apt update && apt upgrade -y + + apt install -y git wget bzip2 file libwine-dev unzip libtool libtool-bin libltdl-dev pkg-config ant \ + build-essential automake texinfo yasm p7zip-full autopoint \ + gettext cmake zip wine nsis g++-mingw-w64-i686 curl gperf flex bison \ + libcurl4-gnutls-dev python3 python3-setuptools python3-mako python3-requests \ + gcc make procps ca-certificates \ + openjdk-11-jdk-headless nasm jq gnupg \ + meson autoconf dos2unix + + wget https://github.com/mstorsjo/llvm-mingw/releases/download/20220906/llvm-mingw-20220906-msvcrt-ubuntu-18.04-x86_64.tar.xz + tar xvf llvm-mingw-20220906-msvcrt-ubuntu-18.04-x86_64.tar.xz -C /opt + export PATH=/opt/llvm-mingw-20220906-msvcrt-ubuntu-18.04-x86_64/bin:$PATH + + update-alternatives --set java /usr/lib/jvm/java-11-openjdk-amd64/bin/java + chmod -R 777 /project && git config --global --add safe.directory '*' + + mkdir /project/build && cd /project/build + ../extras/package/win32/build.sh -a x86_64 -l -r -i r || + ../extras/package/win32/build.sh -a x86_64 -l -r -i r || + ../extras/package/win32/build.sh -a x86_64 -l -r -i r || : + + cd win64 + mv vlc-*-win64.zip vlc-win-${{ matrix.arch }}.zip + chmod 777 vlc-win-${{ matrix.arch }}.zip + + - name: Upload binaries + uses: simplex-chat/action-gh-release@v2 + with: + append_body: true + fail_on_unmatched_files: true + files: ./build/win64/vlc-win-${{ matrix.arch }}.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/linux_util_free_space.sh b/.github/workflows/linux_util_free_space.sh new file mode 100755 index 000000000000..ef00eb886e7a --- /dev/null +++ b/.github/workflows/linux_util_free_space.sh @@ -0,0 +1,96 @@ +#!/usr/bin/env bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# Taken from: https://github.com/apache/arrow/blob/main/ci/scripts/util_free_space.sh + +set -eux + +df -h +echo "::group::/usr/local/*" +du -hsc /usr/local/* +echo "::endgroup::" +# ~1GB +sudo rm -rf \ + /usr/local/aws-sam-cil \ + /usr/local/julia* || : +echo "::group::/usr/local/bin/*" +du -hsc /usr/local/bin/* +echo "::endgroup::" +# ~1GB (From 1.2GB to 214MB) +sudo rm -rf \ + /usr/local/bin/aliyun \ + /usr/local/bin/azcopy \ + /usr/local/bin/bicep \ + /usr/local/bin/cmake-gui \ + /usr/local/bin/cpack \ + /usr/local/bin/helm \ + /usr/local/bin/hub \ + /usr/local/bin/kubectl \ + /usr/local/bin/minikube \ + /usr/local/bin/node \ + /usr/local/bin/packer \ + /usr/local/bin/pulumi* \ + /usr/local/bin/sam \ + /usr/local/bin/stack \ + /usr/local/bin/terraform || : +# 142M +sudo rm -rf /usr/local/bin/oc || : \ +echo "::group::/usr/local/share/*" +du -hsc /usr/local/share/* +echo "::endgroup::" +# 506MB +sudo rm -rf /usr/local/share/chromium || : +# 1.3GB +sudo rm -rf /usr/local/share/powershell || : +echo "::group::/usr/local/lib/*" +du -hsc /usr/local/lib/* +echo "::endgroup::" +# 15GB +sudo rm -rf /usr/local/lib/android || : +# 341MB +sudo rm -rf /usr/local/lib/heroku || : +# 1.2GB +sudo rm -rf /usr/local/lib/node_modules || : +echo "::group::/opt/*" +du -hsc /opt/* +echo "::endgroup::" +# 679MB +sudo rm -rf /opt/az || : +echo "::group::/opt/microsoft/*" +du -hsc /opt/microsoft/* +echo "::endgroup::" +# 197MB +sudo rm -rf /opt/microsoft/powershell || : +echo "::group::/opt/hostedtoolcache/*" +du -hsc /opt/hostedtoolcache/* +echo "::endgroup::" +# 5.3GB +sudo rm -rf /opt/hostedtoolcache/CodeQL || : +# 1.4GB +sudo rm -rf /opt/hostedtoolcache/go || : +# 489MB +sudo rm -rf /opt/hostedtoolcache/PyPy || : +# 376MB +sudo rm -rf /opt/hostedtoolcache/node || : +# Remove Web browser packages +sudo apt purge -y \ + firefox \ + google-chrome-stable \ + microsoft-edge-stable +df -h diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 0b0ee9cc2032..000000000000 --- a/.gitignore +++ /dev/null @@ -1,55 +0,0 @@ -*~ -*.app -*.cache -*.dylib -*.lo -*.lo? -*.la -*.moc.cpp -*.o -*.so -*.trs -*.pc -*.vlt -*.class -*.dmg -.DS_Store -.deps -.libs -.dirstamp -ABOUT-NLS -aclocal.m4 -ChangeLog -compile -config.status -config.h* -config.log -configure -doltcompile -doltlibtool -INSTALL.git -libtool -Makefile -Makefile.in -stamp-* -vlc -vlc.exe -qvlc -rvlc -svlc -cvlc -qvlc -mvlc -nvlc -wxvlc -vlc_install_dir/* -plugins.dat -patches/* - -include/vlc/libvlc_version.h - -# Ignore build dirs -build* -contrib-* -install-* - diff --git a/contrib/src/libarchive/rules.mak b/contrib/src/libarchive/rules.mak index 9e094257da3b..448c40d8ba41 100644 --- a/contrib/src/libarchive/rules.mak +++ b/contrib/src/libarchive/rules.mak @@ -30,6 +30,6 @@ endif cd $< && $(HOSTVARS) ./configure $(HOSTCONF) \ --disable-bsdcpio --disable-bsdtar --disable-bsdcat \ --without-nettle --without-cng \ - --without-xml2 --without-lzma --without-iconv --without-expat + --without-xml2 --without-lzma --without-iconv --without-expat --without-zstd --without-lz4 cd $< && $(MAKE) install touch $@ diff --git a/extras/package/macosx/build.sh b/extras/package/macosx/build.sh index 931979fd4407..653ee18095ea 100755 --- a/extras/package/macosx/build.sh +++ b/extras/package/macosx/build.sh @@ -9,7 +9,7 @@ info() } ARCH="x86_64" -MINIMAL_OSX_VERSION="10.7" +MINIMAL_OSX_VERSION="10.13" OSX_KERNELVERSION=`uname -r | cut -d. -f1` BUILD_ARCH=`uname -m | cut -d. -f1` SDKROOT=$(xcrun --show-sdk-path) @@ -160,7 +160,7 @@ export RANLIB="`xcrun --find ranlib`" export STRINGS="`xcrun --find strings`" export STRIP="`xcrun --find strip`" export SDKROOT -export PATH="${vlcroot}/extras/tools/build/bin:${vlcroot}/contrib/${BUILD_TRIPLET}/bin:$python3Path:${VLC_PATH}:/bin:/sbin:/usr/bin:/usr/sbin" +export PATH="${vlcroot}/extras/tools/build/bin:${vlcroot}/contrib/${BUILD_TRIPLET}/bin:$python3Path:${VLC_PATH}:/usr/local/opt/coreutils/libexec/gnubin:/bin:/sbin:/usr/bin:/usr/sbin" # Select avcodec flavor to compile contribs with export USE_FFMPEG=1 @@ -238,9 +238,9 @@ spopd # enabled. (e.g. ffmpeg) # - This will fail the build if a partially available symbol is added later on # in contribs and not mentioned in the list of symbols above. -export CFLAGS="-Werror=partial-availability" -export CXXFLAGS="-Werror=partial-availability" -export OBJCFLAGS="-Werror=partial-availability" +export CFLAGS="-Werror=partial-availability -Wno-implicit-int" +export CXXFLAGS="-Werror=partial-availability -Wno-implicit-int" +export OBJCFLAGS="-Werror=partial-availability -Wno-implicit-int" export EXTRA_CFLAGS="-isysroot $SDKROOT -mmacosx-version-min=$MINIMAL_OSX_VERSION -DMACOSX_DEPLOYMENT_TARGET=$MINIMAL_OSX_VERSION -arch $ACTUAL_ARCH" export EXTRA_LDFLAGS="-Wl,-syslibroot,$SDKROOT -mmacosx-version-min=$MINIMAL_OSX_VERSION -isysroot $SDKROOT -DMACOSX_DEPLOYMENT_TARGET=$MINIMAL_OSX_VERSION -arch $ACTUAL_ARCH" @@ -250,7 +250,7 @@ export XCODE_FLAGS="MACOSX_DEPLOYMENT_TARGET=$MINIMAL_OSX_VERSION -sdk macosx WA info "Building contribs" spushd "${vlcroot}/contrib" mkdir -p contrib-$HOST_TRIPLET && cd contrib-$HOST_TRIPLET -../bootstrap --build=$BUILD_TRIPLET --host=$HOST_TRIPLET > $out +../bootstrap --build=$BUILD_TRIPLET --host=$HOST_TRIPLET --disable-breakpad --disable-growl --disable-sparkle > $out if [ "$REBUILD" = "yes" ]; then make clean fi @@ -322,6 +322,7 @@ if [ "${vlcroot}/configure" -nt Makefile ]; then --host=$HOST_TRIPLET \ --with-macosx-version-min=$MINIMAL_OSX_VERSION \ --with-macosx-sdk=$SDKROOT \ + --disable-sparkle \ $CONFIGFLAGS \ $VLC_CONFIGURE_ARGS > $out fi diff --git a/src/modules/bank.c b/src/modules/bank.c index 52037d5b590c..8960a1df2a79 100644 --- a/src/modules/bank.c +++ b/src/modules/bank.c @@ -280,7 +280,7 @@ static int AllocatePluginFile (module_bank_t *bank, const char *abspath, if (plugin != NULL && (plugin->mtime != (int64_t)st->st_mtime - || plugin->size != (uint64_t)st->st_size)) + || plugin->size != (uint64_t)st->st_size) && false) { msg_Err(bank->obj, "stale plugins cache: modified %s", plugin->abspath);