Skip to content

Commit

Permalink
Merge pull request #45 from gamingdoom/unstable
Browse files Browse the repository at this point in the history
v0.4.0. Fix #22, use cross compilation for Windows builds
  • Loading branch information
gamingdoom committed Feb 4, 2023
2 parents 40b7ea4 + 0c6cd55 commit 66976a6
Show file tree
Hide file tree
Showing 95 changed files with 992 additions and 660 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/build-linux-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master, unstable ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down Expand Up @@ -53,18 +51,24 @@ jobs:
run: |
mkdir datcord
tar --strip-components=1 -xvf mozilla-unified/obj-x86_64-pc-linux-gnu/dist/*.tar.bz2 -C datcord/
mv datcord/firefox datcord/datcord
mv datcord/firefox-bin datcord/datcord-bin
mv distribution datcord/distribution
#mv datcord/firefox datcord/datcord
#mv datcord/firefox-bin datcord/datcord-bin
cp -r distribution/ datcord/
mv datcord/distribution/policies-linux.json datcord/distribution/policies.json
cp open-in-default-browser/open-in-default-browser datcord/open-in-default-browser
cp src/launch-datcord datcord/launch-datcord
tar -cjf datcord.tar.bz2 datcord
- name: Appimage it
run: |
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod a+x appimagetool-x86_64.AppImage
mkdir -p datcord.AppImage/usr/bin/
tar --strip-components=1 -xvf mozilla-unified/obj-x86_64-pc-linux-gnu/dist/*.tar.bz2 -C datcord.AppImage/usr/bin/
mv datcord.AppImage/usr/bin/firefox datcord.AppImage/usr/bin/datcord
mv datcord.AppImage/usr/bin/firefox-bin datcord.AppImage/usr/bin/datcord-bin
#mv datcord.AppImage/usr/bin/firefox datcord.AppImage/usr/bin/datcord
#mv datcord.AppImage/usr/bin/firefox-bin datcord.AppImage/usr/bin/datcord-bin
cp -r distribution/ datcord.AppImage/usr/bin/
mv datcord.AppImage/usr/bin/distribution/policies-linux-appimage.json datcord.AppImage/usr/bin/distribution/policies.json
cp open-in-default-browser/open-in-default-browser datcord.AppImage/usr/bin/
ARCH=x86_64 ./appimagetool-x86_64.AppImage datcord.AppImage/
- name: Upload a Build Artifact
Expand Down
91 changes: 73 additions & 18 deletions .github/workflows/build-win64.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: Build-Win64
name: Build-Cross-Win-x86_64

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master, unstable ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -16,35 +14,92 @@ jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: windows-2019
runs-on: self-hosted

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

#- name: Cache
# uses: actions/[email protected]
# with:
# path: mozilla-unified
# key: ${{ runner.os }}-mozilla-unified

- name: Cache
uses: actions/[email protected]
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: mozilla-unified
# An explicit key for restoring and saving the cache
key: ${{ runner.os }}-mozilla-unified
# Add mask
- name: add log mask
run: echo "::add-mask::${{ secrets.USERNAME }}"

# Runs a set of commands using the runners shell
- name: Run a multi-line script
- name: Get deps, build and package
run: |
choco install mozillabuild cygwin nsis
choco install --force git
refreshenv
C:\mozilla-build\start-shell.bat /d/a/datcord/datcord/buildDatcordWin.sh
move C:/Users/runneradmin/mozilla-unified/obj-x86_64-pc-mingw32/dist/install/sea/*.exe C:/Users/runneradmin/mozilla-unified/obj-x86_64-pc-mingw32/dist/install/sea/datcordSetup-win64.exe
ls
# These apt commands are used for installing deps for builds on debian. They are not used on my self-hosted runner
#sudo apt upgrade && sudo apt update
#sudo add-apt-repository universe
#sudo apt install libfuse2
#sudo apt install python3 python3-distutils python3-pip build-essential libpython3-dev m4 nodejs unzip uuid zip libasound2-dev libcurl4-openssl-dev libdbus-1-dev libdbus-glib-1-dev libdrm-dev libgtk-3-dev libpulse-dev libx11-xcb-dev libxt-dev xvfb rustc clang nasm
#sudo apt install mercurial python3 python3-dev python3-pip curl wget dpkg-sig msitools p7zip-full upx-ucl libssl-dev zstd wine64-tools wine
pip3 install --upgrade setuptools
pip3 install wheel setuptools zstandard==0.15.2 cffi>=1.13.0 glean-parser==2.5.0 appdirs>=1.4 Click>=7 diskcache>=4 importlib-metadata iso8601>=0.1.10 Jinja2>=2.10.1 jsonschema>=3.0.2 attrs>=17.4.0 MarkupSafe>=2.0 pycparser pyrsistent>=0.14.0 PyYAML>=3.13 six>=1.11.0 typing-extensions>=3.6.4 yamllint>=1.18.0 pathspec>=0.5.3 zipp>=0.5 psutil==5.8.0
bash ./crossCompileForWindows.sh
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
# Artifact name
name: win64-installer
# A file, directory or wildcard pattern that describes what to upload
path: work/datcordSetup-win64.exe

# name: Build-Win64

# # Controls when the workflow will run
# on:
# # Triggers the workflow on push or pull request events but only for the master branch
# push:
# branches: [ master, unstable ]
# pull_request:
# branches: [ master ]

# # Allows you to run this workflow manually from the Actions tab
# workflow_dispatch:

# # A workflow run is made up of one or more jobs that can run sequentially or in parallel
# jobs:
# # This workflow contains a single job called "build"
# build:
# # The type of runner that the job will run on
# runs-on: windows-latest

# # Steps represent a sequence of tasks that will be executed as part of the job
# steps:
# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# - uses: actions/checkout@v2

# - name: Cache
# uses: actions/[email protected]
# with:
# # A list of files, directories, and wildcard patterns to cache and restore
# path: mozilla-unified
# # An explicit key for restoring and saving the cache
# key: ${{ runner.os }}-mozilla-unified

# # Runs a set of commands using the runners shell
# - name: Run a multi-line script
# run: |
# choco install mozillabuild cygwin nsis
# choco install --force git
# refreshenv
# C:\mozilla-build\start-shell.bat /d/a/datcord/datcord/buildDatcordWin.sh
# move C:/Users/runneradmin/mozilla-unified/obj-x86_64-pc-mingw32/dist/install/sea/*.exe C:/Users/runneradmin/mozilla-unified/obj-x86_64-pc-mingw32/dist/install/sea/datcordSetup-win64.exe

# - name: Upload a Build Artifact
# uses: actions/[email protected]
# with:
# # Artifact name
# name: win64-installer
# # A file, directory or wildcard pattern that describes what to upload
# path: work/datcordSetup-win64.exe

# This is a basic workflow to help you get started with Actions
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,5 @@ Datcord-x86_64.AppImage
# Ignore build dir
build/
mozilla-unified/
work/

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<br />
<div align="center">
<a href="https://github.com/othneildrew/Best-README-Template">
<img src="changed/browser/branding/unofficial/default256.png" alt="Logo" width="80" height="80">
<a href="https://github.com/gamingdoom/datcord">
<img src="src/changed/browser/branding/datcord/default256.png" alt="Logo" width="80" height="80">
</a>

<h3 align="center">Datcord</h3>
Expand Down
6 changes: 4 additions & 2 deletions buildDatcord.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ if [ ! -d $mozbuild/git-cinnabar ]; then
fi

cd mozilla-unified
cp -r ../changed/* .
patch -p1 ../mozilla_dirsFromLibreWolf.patch
cp -r ../src/changed/* .
cp ../src/mozconfig.linux mozconfig
patch -p1 < ../mozilla_dirsFromLibreWolf.patch

./mach configure
./mach build
./mach package
11 changes: 5 additions & 6 deletions buildDatcordWin.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
# Run with MozillaBuild
basedir=$(dirname "$0")
if [[ ! -d mozilla-unified ]]
if [ ! -d mozilla-unified ]
then
curl https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py --output bootstrap.py
python3 bootstrap.py --no-interactive
fi
cp -rf $basedir/changed/* mozilla-unified/
cp -rf $basedir/src/changed/* mozilla-unified/
# It is using nightly branding no matter what so we replace the nightly stuff with our stuff
cp -rf mozilla-unified/browser/branding/unofficial/* mozilla-unified/browser/branding/nightly/*
cd mozilla-unified
echo "ac_add_options --disable-default-browser-agent" >> mozconfig
echo "ac_add_options --disable-default-browser-agent" > mozconfig
echo "ac_add_options --enable-release" >> mozconfig
# Doesn't work properly if app name is datcord.
echo "ac_add_options --with-app-name=firefox" >> mozconfig
echo "ac_add_options --with-branding=browser/branding/unofficial" >> mozconfig
echo "ac_add_options --with-branding=browser/branding/datcord" >> mozconfig
cat mozconfig
patch -p1 $basedir/mozilla_dirsFromLibreWolf.patch
patch -p1 < $basedir/mozilla_dirsFromLibreWolf.patch
./mach build
./mach package

Expand Down
19 changes: 0 additions & 19 deletions changed/browser/branding/unofficial/configure.sh

This file was deleted.

Binary file removed changed/browser/branding/unofficial/firefox.ico
Binary file not shown.
Binary file removed changed/browser/branding/unofficial/firefox64.ico
Binary file not shown.
Loading

0 comments on commit 66976a6

Please sign in to comment.