fix: noconfirm auto-selects first AUR match
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>MyApp</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>myapp.sh</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.example.me</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>myapp</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>myapp.icns</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>IFMajorVersion</key>
|
||||
<integer>0</integer>
|
||||
<key>IFMinorVersion</key>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
</plist>
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh -eu
|
||||
|
||||
curdir=`pwd`
|
||||
rm -rf buildtmp
|
||||
mkdir buildtmp
|
||||
LDFLAGS=-static-libstdc++ ~/meson/meson.py buildtmp --buildtype=release --prefix=/tmp/myapp --libdir=lib --strip
|
||||
ninja -C buildtmp install
|
||||
rm -rf buildtmp
|
||||
cd /tmp/
|
||||
tar czf myapp.tar.gz myapp
|
||||
mv myapp.tar.gz "$curdir"
|
||||
rm -rf myapp
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh -eu
|
||||
|
||||
rm -rf buildtmp
|
||||
mkdir buildtmp
|
||||
~/meson/meson.py buildtmp --buildtype=release --prefix=/tmp/myapp.app --bindir=Contents/MacOS
|
||||
ninja -C buildtmp install
|
||||
rm -rf buildtmp
|
||||
mkdir -p mnttmp
|
||||
rm -f working.dmg
|
||||
gunzip < template.dmg.gz > working.dmg
|
||||
hdiutil attach working.dmg -noautoopen -quiet -mountpoint mnttmp
|
||||
rm -rf mnttmp/myapp.app
|
||||
mv /tmp/myapp.app mnttmp
|
||||
# NOTE: output of hdiutil changes every now and then.
|
||||
# Verify that this is still working.
|
||||
hdiutil detach $(hdiutil info|grep "mnttmp"|awk '{print $1}')
|
||||
rm -rf mnttmp
|
||||
rm -f myapp.dmg
|
||||
hdiutil convert working.dmg -quiet -format UDZO -imagekey zlib-level=9 -o myapp.dmg
|
||||
rm -f working.dmg
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os, urllib.request, shutil, subprocess
|
||||
from glob import glob
|
||||
|
||||
sdl_url = 'http://libsdl.org/release/SDL2-devel-2.0.3-VC.zip'
|
||||
sdl_filename = 'SDL2-devel-2.0.3-VC.zip'
|
||||
sdl_dir = 'SDL2-2.0.3'
|
||||
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
os.mkdir('build')
|
||||
|
||||
if not os.path.exists(sdl_filename):
|
||||
response = urllib.request.urlopen(sdl_url, timeout=600.0)
|
||||
data = response.read()
|
||||
open(sdl_filename, 'wb').write(data)
|
||||
|
||||
shutil.unpack_archive(sdl_filename, 'build')
|
||||
|
||||
libs = glob(os.path.join('build', sdl_dir, 'lib/x86/*'))
|
||||
[shutil.copy(x, 'build') for x in libs]
|
||||
|
||||
# Sorry for this hack but this needs to work during development
|
||||
# when Meson is not in path.
|
||||
subprocess.check_call(['python3', r'..\..\meson.py', 'build',
|
||||
'--backend=ninja', '--buildtype=release'])
|
||||
subprocess.check_call(['ninja'], cwd='build')
|
||||
shutil.copy('myapp.iss', 'build')
|
||||
subprocess.check_call([r'\Program Files\Inno Setup 5\ISCC.exe', 'myapp.iss'],
|
||||
cwd='build')
|
||||
shutil.copy('build/setup.exe', 'myapp 1.0.exe')
|
||||
shutil.rmtree('build')
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh -eu
|
||||
|
||||
libdir="${MESON_INSTALL_PREFIX}/lib"
|
||||
mkdir -p $libdir
|
||||
sdlfile=`ldd ${MESON_INSTALL_PREFIX}/bin/myapp | grep libSDL | cut -d ' ' -f 3`
|
||||
cp $sdlfile "${libdir}"
|
||||
strip "${libdir}/libSDL"*
|
||||
@@ -0,0 +1,38 @@
|
||||
project('myapp', 'cpp')
|
||||
|
||||
sdl = dependency('sdl2', required : host_machine.system() != 'windows')
|
||||
|
||||
if meson.get_compiler('cpp').get_id() != 'msvc'
|
||||
add_global_arguments('-std=c++11', language : 'cpp')
|
||||
endif
|
||||
|
||||
if host_machine.system() == 'darwin'
|
||||
install_data('myapp.sh',
|
||||
install_dir : 'Contents/MacOS')
|
||||
|
||||
install_data('myapp.icns',
|
||||
install_dir : 'Contents/Resources')
|
||||
|
||||
install_data('Info.plist',
|
||||
install_dir : 'Contents')
|
||||
|
||||
meson.add_install_script('osx_bundler.sh')
|
||||
endif
|
||||
|
||||
if host_machine.system() == 'linux'
|
||||
install_data('myapp.sh', install_dir : '.')
|
||||
meson.add_install_script('linux_bundler.sh')
|
||||
endif
|
||||
|
||||
extra_link_args = []
|
||||
|
||||
if host_machine.system() == 'windows'
|
||||
str = '-I@0@/@1@'.format(meson.current_build_dir(), 'SDL2-2.0.3/include')
|
||||
add_global_arguments(str, language : 'cpp')
|
||||
extra_link_args = ['/SUBSYSTEM:CONSOLE', 'SDL2main.lib', 'SDL2.lib']
|
||||
endif
|
||||
|
||||
prog = executable('myapp', 'myapp.cpp',
|
||||
dependencies : sdl,
|
||||
link_args : extra_link_args,
|
||||
install : true)
|
||||
@@ -0,0 +1,39 @@
|
||||
#include<SDL.h>
|
||||
#include<memory>
|
||||
#include<iostream>
|
||||
#include<string>
|
||||
|
||||
int main(void) {
|
||||
SDL_Surface *screenSurface;
|
||||
SDL_Event e;
|
||||
int keepGoing = 1;
|
||||
std::string message;
|
||||
|
||||
if(SDL_Init( SDL_INIT_VIDEO ) < 0) {
|
||||
printf( "SDL could not initialize! SDL_Error: %s\n", SDL_GetError() );
|
||||
}
|
||||
atexit(SDL_Quit);
|
||||
|
||||
std::unique_ptr<SDL_Window, void(*)(SDL_Window*)> window(SDL_CreateWindow( "My application", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN), SDL_DestroyWindow);
|
||||
screenSurface = SDL_GetWindowSurface(window.get());
|
||||
|
||||
// Use iostream to make sure we have not screwed
|
||||
// up libstdc++ linking.
|
||||
message = "Window created.";
|
||||
message += " Starting main loop.";
|
||||
std::cout << message << std::endl;
|
||||
|
||||
while(keepGoing) {
|
||||
while(SDL_PollEvent(&e) != 0) {
|
||||
if(e.type == SDL_QUIT) {
|
||||
keepGoing = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
SDL_FillRect(screenSurface, NULL, SDL_MapRGB(screenSurface->format, 0xFF, 0x00, 0x00));
|
||||
SDL_UpdateWindowSurface(window.get());
|
||||
SDL_Delay(100);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,18 @@
|
||||
; Innosetup file for My app.
|
||||
|
||||
[Setup]
|
||||
AppName=My App
|
||||
AppVersion=1.0
|
||||
DefaultDirName={pf}\My App
|
||||
DefaultGroupName=My App
|
||||
UninstallDisplayIcon={app}\myapp.exe
|
||||
Compression=lzma2
|
||||
SolidCompression=yes
|
||||
OutputDir=.
|
||||
|
||||
[Files]
|
||||
Source: "myapp.exe"; DestDir: "{app}"
|
||||
Source: "SDL2.dll"; DestDir: "{app}"
|
||||
|
||||
;[Icons]
|
||||
;Name: "{group}\My App"; Filename: "{app}\myapp.exe"
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd "${0%/*}"
|
||||
|
||||
if [ `uname` == 'Darwin' ]; then
|
||||
./myapp
|
||||
else
|
||||
export LD_LIBRARY_PATH="`pwd`/lib"
|
||||
bin/myapp
|
||||
fi
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh -eu
|
||||
|
||||
mkdir -p ${MESON_INSTALL_PREFIX}/Contents/Frameworks
|
||||
cp -R /Library/Frameworks/SDL2.framework ${MESON_INSTALL_PREFIX}/Contents/Frameworks
|
||||
|
||||
install_name_tool -change @rpath/SDL2.framework/Versions/A/SDL2 @executable_path/../Frameworks/SDL2.framework/Versions/A/SDL2 ${MESON_INSTALL_PREFIX}/Contents/MacOS/myapp
|
||||
@@ -0,0 +1,11 @@
|
||||
This directory shows how you can build redistributable binaries. On
|
||||
OSX this means building an app bundle and a .dmg installer. On Linux
|
||||
it means building an archive that bundles its dependencies. On Windows
|
||||
it means building an .exe installer.
|
||||
|
||||
To build each package you run the corresponding build_ARCH.sh build
|
||||
script.
|
||||
|
||||
On Linux you must build the package on the oldest distribution you
|
||||
plan to support (Debian stable/oldstable and old CentOS are the common
|
||||
choice here).
|
||||
Binary file not shown.
Reference in New Issue
Block a user