ruby2d 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/README.md +1 -0
- data/assets/linux/simple2d/Makefile +7 -0
- data/assets/linux/simple2d/bin/simple2d.sh +68 -5
- data/assets/macos/lib/libSDL2.a +0 -0
- data/bin/ruby2d +1 -1
- data/ext/ruby2d/extconf.rb +1 -1
- data/lib/ruby2d.rb +1 -1
- data/lib/ruby2d/cli/build.rb +1 -1
- data/lib/ruby2d/cli/colorize.rb +10 -0
- data/lib/ruby2d/version.rb +1 -1
- metadata +4 -4
- data/lib/ruby2d/colorize.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc9cd5ced7c619c8e46e75f6d7995533cda2b25cdb664fada6164d7685ecd3bd
|
4
|
+
data.tar.gz: '068515dfd572e25f244ea194831e6b3ac89fa5ef02899615b5d75c1592f55d35'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 298106e209781cecfbad8c41e5d1076001b9ecaae45826553d8bddfd4569d228896794d1e3150ca1c788984091d504dcc49a2ba8b50bcd0b16a1154fb0654414
|
7
|
+
data.tar.gz: bcd3bf7df06bf2b6bbd424c008abb19abe978be5302ca2731b5badaf1d653c48f5619ca1abdf28538b53d5848d6f703d31173a34ed057c54122609af54c2b541
|
data/assets/README.md
CHANGED
@@ -21,3 +21,4 @@
|
|
21
21
|
- From your local [Simple 2D](https://github.com/simple2d) project
|
22
22
|
- Copy `simple2d.h` to `include/`
|
23
23
|
- Copy the `libsimple2d.a` builds to their respective `macos/lib` and `mingw/lib` directories
|
24
|
+
- Copy `bin/simple2d.sh`, `include/`, `src/`, and `Makefile` to `linux/simple2d/`
|
@@ -26,6 +26,13 @@ ifeq ($(shell uname),Linux)
|
|
26
26
|
CFLAGS+=-fPIC
|
27
27
|
endif
|
28
28
|
|
29
|
+
# BSD
|
30
|
+
ifneq (,$(findstring BSD,$(shell uname)))
|
31
|
+
CC=cc
|
32
|
+
INCLUDES=-I/usr/local/include/
|
33
|
+
CFLAGS+=-fPIC
|
34
|
+
endif
|
35
|
+
|
29
36
|
# MinGW
|
30
37
|
ifneq (,$(findstring MINGW,$(shell uname -s)))
|
31
38
|
PLATFORM=mingw
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#!/bin/bash
|
1
|
+
#!/usr/bin/env bash
|
2
2
|
|
3
3
|
# ------------------------------------------------------------------------------
|
4
4
|
# The Simple 2D Command-Line Utility for Unix-like Systems
|
@@ -333,6 +333,32 @@ have_sdl_libs?() {
|
|
333
333
|
}
|
334
334
|
|
335
335
|
|
336
|
+
# Installs SDL on BSD
|
337
|
+
install_sdl_bsd() {
|
338
|
+
|
339
|
+
echo "The following packages will be installed:"
|
340
|
+
echo " sdl2"
|
341
|
+
echo " sdl2_image"
|
342
|
+
echo " sdl2_mixer"
|
343
|
+
echo " sdl2_ttf"
|
344
|
+
|
345
|
+
prompt_to_continue "Install SDL now?"
|
346
|
+
|
347
|
+
print_task "Updating packages" "\n\n"
|
348
|
+
print_and_run "sudo pkg update"
|
349
|
+
|
350
|
+
echo; print_task "Installing packages" "\n\n"
|
351
|
+
print_and_run "sudo pkg install sdl2 sdl2_image sdl2_mixer sdl2_ttf"
|
352
|
+
echo
|
353
|
+
|
354
|
+
if ! have_sdl_libs?; then
|
355
|
+
echo; error_msg "SDL libraries did not install correctly"; exit 1
|
356
|
+
else
|
357
|
+
echo; info_msg "SDL was installed successfully"
|
358
|
+
fi
|
359
|
+
}
|
360
|
+
|
361
|
+
|
336
362
|
# Installs SDL on Linux
|
337
363
|
install_sdl_linux() {
|
338
364
|
|
@@ -502,6 +528,8 @@ install_sdl_source() {
|
|
502
528
|
install_sdl() {
|
503
529
|
if [[ $platform == 'linux' ]]; then
|
504
530
|
install_sdl_linux
|
531
|
+
elif [[ $platform == 'bsd' ]]; then
|
532
|
+
install_sdl_bsd
|
505
533
|
elif [[ $platform == 'arm' ]]; then
|
506
534
|
install_sdl_source
|
507
535
|
fi
|
@@ -552,7 +580,7 @@ install_s2d() {
|
|
552
580
|
fi
|
553
581
|
|
554
582
|
echo; print_task "Unpacking" "\n\n"
|
555
|
-
print_and_run "unzip -q $tmp_dir/$f_name -d $tmp_dir"
|
583
|
+
print_and_run "unzip -q $tmp_dir/$f_name.zip -d $tmp_dir"
|
556
584
|
|
557
585
|
# Check if archive was unpacked properly
|
558
586
|
if [[ $? != 0 ]]; then
|
@@ -561,8 +589,13 @@ install_s2d() {
|
|
561
589
|
|
562
590
|
print_and_run "cd $tmp_dir/simple2d-$1"
|
563
591
|
|
564
|
-
|
565
|
-
|
592
|
+
if [[ $platform == 'bsd' ]]; then
|
593
|
+
echo; print_and_run "gmake"
|
594
|
+
echo; print_and_run "sudo gmake install"
|
595
|
+
else
|
596
|
+
echo; print_and_run "make"
|
597
|
+
echo; print_and_run "sudo make install"
|
598
|
+
fi
|
566
599
|
|
567
600
|
echo; print_task "Cleaning up" "\n"; echo
|
568
601
|
print_and_run "rm -rf $tmp_dir"; echo
|
@@ -644,6 +677,29 @@ install() {
|
|
644
677
|
# Uninstall ####################################################################
|
645
678
|
|
646
679
|
|
680
|
+
# Uninstalls SDL on BSD
|
681
|
+
uninstall_sdl_bsd() {
|
682
|
+
|
683
|
+
echo "The following packages will be removed:"
|
684
|
+
echo " sdl2"
|
685
|
+
echo " sdl2_image"
|
686
|
+
echo " sdl2_mixer"
|
687
|
+
echo " sdl2_ttf"
|
688
|
+
|
689
|
+
prompt_to_continue "Uninstall SDL now?"
|
690
|
+
|
691
|
+
echo; print_task "Uninstalling packages" "\n\n"
|
692
|
+
print_and_run "sudo pkg remove sdl2 sdl2_image sdl2_mixer sdl2_ttf"
|
693
|
+
echo
|
694
|
+
|
695
|
+
if have_sdl_libs?; then
|
696
|
+
echo; error_msg "SDL libraries did not uninstall correctly"
|
697
|
+
else
|
698
|
+
echo; info_msg "SDL was uninstalled successfully"
|
699
|
+
fi
|
700
|
+
}
|
701
|
+
|
702
|
+
|
647
703
|
# Uninstalls SDL on Linux
|
648
704
|
uninstall_sdl_linux() {
|
649
705
|
|
@@ -757,6 +813,8 @@ uninstall_sdl() {
|
|
757
813
|
|
758
814
|
if [[ $platform == 'linux' ]]; then
|
759
815
|
uninstall_sdl_linux
|
816
|
+
elif [[ $platform == 'bsd' ]]; then
|
817
|
+
uninstall_sdl_bsd
|
760
818
|
elif [[ $platform == 'arm' ]]; then
|
761
819
|
uninstall_sdl_source
|
762
820
|
fi
|
@@ -1090,6 +1148,11 @@ elif [[ $unamestr == 'Linux' ]]; then
|
|
1090
1148
|
elif [[ $unamestr =~ 'MINGW' ]]; then
|
1091
1149
|
platform_display='Windows / MinGW'
|
1092
1150
|
platform='mingw'
|
1151
|
+
|
1152
|
+
# BSD
|
1153
|
+
elif [[ $unamestr =~ 'BSD' ]]; then
|
1154
|
+
platform_display='BSD'
|
1155
|
+
platform='bsd'
|
1093
1156
|
fi
|
1094
1157
|
|
1095
1158
|
# Unsupported platform
|
@@ -1226,7 +1289,7 @@ case $1 in
|
|
1226
1289
|
--libs)
|
1227
1290
|
if [[ $platform == 'macos' ]]; then
|
1228
1291
|
FLAGS='-Wl,-framework,OpenGL'
|
1229
|
-
elif [[ $platform == 'linux' ]]; then
|
1292
|
+
elif [[ $platform == 'linux' || $platform == 'bsd' ]]; then
|
1230
1293
|
FLAGS='-lGL -lm'
|
1231
1294
|
elif [[ $platform == 'arm' ]]; then
|
1232
1295
|
FLAGS='-lm -I/opt/vc/include/ -L/opt/vc/lib'
|
data/assets/macos/lib/libSDL2.a
CHANGED
Binary file
|
data/bin/ruby2d
CHANGED
data/ext/ruby2d/extconf.rb
CHANGED
data/lib/ruby2d.rb
CHANGED
data/lib/ruby2d/cli/build.rb
CHANGED
@@ -0,0 +1,10 @@
|
|
1
|
+
# String#ruby2d_colorize
|
2
|
+
|
3
|
+
# Extend `String` to include some fancy colors
|
4
|
+
class String
|
5
|
+
def ruby2d_colorize(c); "\e[#{c}m#{self}\e[0m" end
|
6
|
+
def bold; ruby2d_colorize('1') end
|
7
|
+
def info; ruby2d_colorize('1;34') end
|
8
|
+
def warn; ruby2d_colorize('1;33') end
|
9
|
+
def error; ruby2d_colorize('1;31') end
|
10
|
+
end
|
data/lib/ruby2d/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby2d
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Black
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -281,11 +281,11 @@ files:
|
|
281
281
|
- lib/ruby2d.rb
|
282
282
|
- lib/ruby2d/circle.rb
|
283
283
|
- lib/ruby2d/cli/build.rb
|
284
|
+
- lib/ruby2d/cli/colorize.rb
|
284
285
|
- lib/ruby2d/cli/console.rb
|
285
286
|
- lib/ruby2d/cli/enable_console.rb
|
286
287
|
- lib/ruby2d/cli/launch.rb
|
287
288
|
- lib/ruby2d/color.rb
|
288
|
-
- lib/ruby2d/colorize.rb
|
289
289
|
- lib/ruby2d/dsl.rb
|
290
290
|
- lib/ruby2d/exceptions.rb
|
291
291
|
- lib/ruby2d/font.rb
|
@@ -321,7 +321,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
321
321
|
- !ruby/object:Gem::Version
|
322
322
|
version: '0'
|
323
323
|
requirements: []
|
324
|
-
rubygems_version: 3.
|
324
|
+
rubygems_version: 3.1.2
|
325
325
|
signing_key:
|
326
326
|
specification_version: 4
|
327
327
|
summary: Ruby 2D
|
data/lib/ruby2d/colorize.rb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
# String#colorize
|
2
|
-
|
3
|
-
# Extend `String` to include some fancy colors
|
4
|
-
class String
|
5
|
-
def colorize(c); "\e[#{c}m#{self}\e[0m" end
|
6
|
-
def bold; colorize('1') end
|
7
|
-
def info; colorize('1;34') end
|
8
|
-
def warn; colorize('1;33') end
|
9
|
-
def error; colorize('1;31') end
|
10
|
-
end
|