Skip to content

Commit 6287828

Browse files
committed
first working 64-bit build
1 parent c847ab1 commit 6287828

24 files changed

Lines changed: 708 additions & 262 deletions

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ jobs:
3131
name: Install Dependencies
3232
run: |
3333
choco install wget --no-progress
34-
wget https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2032%20bits/Lazarus%204.2/lazarus-4.2-fpc-3.2.2-win32.exe/download -O lazarus-installer.exe --timeout 60 --progress=dot:giga
34+
wget https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%204.2/lazarus-4.2-fpc-3.2.2-win64.exe/download -O lazarus-installer.exe --timeout 60 --progress=dot:giga
3535
Start-Process -FilePath "./lazarus-installer.exe" -ArgumentList "/verysilent" -Wait
3636
wget "https://sourceforge.net/projects/nsis/files/NSIS%203/3.05/nsis-3.05-setup.exe/download" -O nsis-3.05-setup.exe --timeout 60
3737
./nsis-3.05-setup.exe /S
3838
- name: Build
3939
run: |
40-
c:\lazarus\lazbuild src\ultrastardx-win.lpi --lazarusdir=c:\lazarus
40+
c:\lazarus\lazbuild src\ultrastardx-win.lpi --lazarusdir=c:\lazarus --os=win64 --cpu=x86_64
4141
- name: Add prebuilt DLLs
4242
run: |
4343
python dldlls.py
44-
7z x -y usdx-dlls-i686.zip -ogame "*.dll"
44+
7z x -y usdx-dlls-x86_64.zip -ogame "*.dll"
4545
env:
4646
ARTIFACT_ACCESS_TOKEN: ${{ secrets.MxeActionsReadAccessToken }}
4747
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

COMPILING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ For linking and running the game, the following libraries are also required:
1212
- OpenCV if you want webcam support
1313
- projectM 2,x if you want audio visualisation support
1414

15-
Prebuilt DLLs for SDL2, SDL2_image, FFmpeg, SQLite, PortAudio, and Lua can be found in the releases section of [our MXE fork](https://github.com/UltraStar-Deluxe/mxe). You can use the dldlls.py script to download the DLLs for the checked out code. The remaining DLLs needed for Windows builds are part of this repository.
15+
Prebuilt DLLs for SDL2, SDL2_image, FFmpeg, SQLite, PortAudio, and Lua can be found in the releases section of [our MXE fork](https://github.com/UltraStar-Deluxe/mxe). You can use the dldlls.py script to download the DLLs for the checked out code (set `--arch x86_64` for 64-bit bundles, or set `USDX_DLL_ARCH=x86_64`). The remaining DLLs needed for Windows builds are part of this repository.
1616

1717
## Compiling using Lazarus
1818
1. Start Lazarus.
1919
2. Choose Project → Open Project … in the menu bar. A file-dialog box will show.
2020
3. Change to the src subdirectory of your USDX working copy (e.g. ultrastardx/src).
21-
* If you are running Windows, open the ultrastardx-win.lpi project-file (Preferably use the win32 verison of lazarus, as the included libraries are 32 bit).
21+
* If you are running Windows, open the ultrastardx-win.lpi project-file (use the win64 version of Lazarus, as the included libraries are 64 bit).
2222
* On Unix-like systems use the ultrastardx-unix.lpi file.
2323
4. Now you can compile USDX by choosing the menu entry Run → Build or pressing Ctrl+F9.
2424
5. If you want to compile and/or start USDX directly choose Run → Run or press F9.
@@ -43,10 +43,10 @@ Optional libraries:
4343

4444
#### Windows using MSYS2
4545
- Install [MSYS2](https://www.msys2.org)
46-
- Install [FPC](https://www.freepascal.org). You need at least a custom installation with the Free Pascal Utils (for `fpcres`) and the Units.
46+
- Install [FPC](https://www.freepascal.org). You need a Windows 64-bit installation with Free Pascal Utils (for `fpcres`) and Units.
4747
- `pacman -S autoconf-wrapper automake-wrapper gcc git make mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_gfx mingw-w64-x86_64-SDL2_image mingw-w64-x86_64-SDL2_mixer mingw-w64-x86_64-SDL2_net mingw-w64-x86_64-SDL2_ttf mingw-w64-x86_64-ffmpeg mingw-w64-x86_64-lua51 pkgconf`
4848
- Add some information to `.bash_profile`:
49-
* Path to FPC, something like `PATH="${PATH}:/c/FPC/3.2.2/bin/i386-win32"`
49+
* Path to FPC, something like `PATH="${PATH}:/c/FPC/3.2.2/bin/x86_64-win64"`
5050
* Path to mingw64 libraries, `PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/mingw64/lib/pkgconfig"`
5151

5252
### Compile and run

dists/autogen/m4/fpc.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ AC_ARG_ENABLE(noexecstack,
113113
# Find compiler executable
114114
###
115115
116-
PPC_CHECK_PROGS="fpc FPC ppc386 ppc PPC386"
116+
PPC_CHECK_PROGS="ppcx64 ppcx64.exe ppcrossx64 ppcrossx64.exe fpc FPC ppc386 ppc PPC386"
117117
118118
if test -z "$PPC_PATH"; then
119119
PPC_PATH=$PATH
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
USDXResCompiler.exe UltraStar.rc
22

3-
C:\lazarus\fpc\2.0.4\bin\i386-win32\ppc386.exe -S2cgi -OG1 -gl -vewnhi -l -Filib\JEDI-SDLv1.0\SDL\Pas\ -Fuc:\lazarus\components\jpeg\lib\i386-win32\ -Fuc:\lazarus\components\images\lib\i386-win32\ -Fuc:\lazarus\lcl\units\i386-win32\ -Fuc:\lazarus\lcl\units\i386-win32\win32\ -Fuc:\lazarus\packager\units\i386-win32\ -Fu. -oUltraStar.exe -dLCL -dLCLwin32 UltraStar.lpr
3+
C:\lazarus\fpc\2.0.4\bin\x86_64-win64\ppcx64.exe -S2cgi -OG1 -gl -vewnhi -l -Filib\JEDI-SDLv1.0\SDL\Pas\ -Fuc:\lazarus\components\jpeg\lib\x86_64-win64\ -Fuc:\lazarus\components\images\lib\x86_64-win64\ -Fuc:\lazarus\lcl\units\x86_64-win64\ -Fuc:\lazarus\lcl\units\x86_64-win64\win32\ -Fuc:\lazarus\packager\units\x86_64-win64\ -Fu. -oUltraStar.exe -dLCL -dLCLwin32 UltraStar.lpr

dldlls.py

Lines changed: 23 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,26 @@
1-
#!/usr/bin/python3
2-
31
import urllib.request
4-
import shutil
52
import json
6-
import sys
7-
import os
8-
9-
sha = '67f6a4f9305a2ee1508215ad4a861f23f7b8e3da'
10-
filename = 'usdx-dlls-i686'
11-
urlbase = 'https://api.github.com/repos/UltraStar-Deluxe/mxe/'
12-
headers = {
13-
'Accept': 'application/vnd.github+json',
14-
'X-GitHub-Api-Version': '2022-11-28'
15-
}
16-
17-
token = os.environ.get('ARTIFACT_ACCESS_TOKEN')
18-
if token == None or token.strip() == '':
19-
token = os.environ.get('GITHUB_TOKEN')
20-
if token != None and token.strip() != '':
21-
headers['Authorization'] = 'Bearer ' + token
22-
23-
print('Searching for binaries built from commit ' + sha)
24-
25-
def search_releases():
26-
pagesuffix = ''
27-
page = 1
28-
links = '"next"'
29-
while links != None and links.find('"next"') != -1:
30-
req = urllib.request.Request(url = urlbase + 'tags' + pagesuffix,
31-
headers = headers)
32-
rsp = urllib.request.urlopen(req)
33-
links = rsp.headers['link']
34-
for tag in json.load(rsp):
35-
if tag['commit']['sha'] == sha:
36-
req = urllib.request.Request(url = urlbase + 'releases/tags/'
37-
+ tag['name'],
38-
headers = headers)
39-
rsp = urllib.request.urlopen(req)
40-
release = json.load(rsp)
41-
for asset in release['assets']:
42-
if asset['name'].startswith(filename):
43-
print('Found binaries in release ' + release['name'])
44-
headers.clear()
45-
return asset['browser_download_url']
46-
page = page + 1
47-
pagesuffix = '?page={}'.format(page)
48-
print('No release matches')
49-
return None
50-
51-
def search_artifacts():
52-
pagesuffix = ''
53-
page = 1
54-
links = '"next"'
55-
while links != None and links.find('"next"') != -1:
56-
req = urllib.request.Request(url = urlbase
57-
+ 'actions/artifacts'
58-
+ '?name=' + filename
59-
+ pagesuffix,
60-
headers = headers)
61-
rsp = urllib.request.urlopen(req)
62-
links = rsp.headers['link']
63-
for artifact in json.load(rsp)['artifacts']:
64-
if artifact['workflow_run']['head_sha'] == sha and not artifact['expired']:
65-
print('Found binaries in workflow run {}'.format(artifact['workflow_run']['id']))
66-
return artifact['archive_download_url']
67-
page = page + 1
68-
pagesuffix = '&page={}'.format(page)
69-
print('No workflow artifact matches')
70-
return None
3+
import re
714

72-
dllurl = search_releases()
73-
if dllurl == None and token != None:
74-
dllurl = search_artifacts()
75-
if dllurl == None:
76-
sys.exit(1)
77-
print('Downloading from ' + dllurl)
78-
req = urllib.request.Request(url = dllurl)
79-
for key in headers:
80-
req.add_unredirected_header(key, headers[key])
81-
shutil.copyfileobj(urllib.request.urlopen(req),
82-
open(filename + '.zip', 'wb'))
5+
api_url = 'https://api.github.com/repos/dgruss/mxe/releases'
6+
with urllib.request.urlopen(api_url) as resp:
7+
releases = json.load(resp)
8+
if not releases:
9+
print('No releases found.')
10+
exit(1)
11+
pattern = r'^usdx-dlls-.*\.zip$'
12+
for release in releases:
13+
for asset in release.get('assets', []):
14+
print(f"Downloading {asset['name']} from release '{release.get('name', release.get('tag_name', ''))}'...")
15+
# Rename to only keep up to the third dash (usdx-dlls-arch.zip)
16+
parts = asset['name'].split('-')
17+
if len(parts) >= 3:
18+
new_name = '-'.join(parts[:3]) + '.zip'
19+
else:
20+
new_name = asset['name']
21+
with urllib.request.urlopen(asset['browser_download_url']) as dl, open(new_name, 'wb') as out:
22+
out.write(dl.read())
23+
print('Download complete.')
24+
exit(0)
25+
print('No usdx-dlls-*.zip asset found in any release.')
26+
exit(1)

game/bass.dll

27.1 KB
Binary file not shown.

game/cv210.dll

-1.99 MB
Binary file not shown.

game/cxcore210.dll

-2.1 MB
Binary file not shown.

game/glew32.dll

200 KB
Binary file not shown.

game/highgui210.dll

-763 KB
Binary file not shown.

0 commit comments

Comments
 (0)