MavenToPKGBUILD 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 44b36cee1fb202e666748a00a5ffdd6ff891c0be3f968de4bfa08f0650a6fa36
4
- data.tar.gz: af9d1929403d9ae5a4dd35b6086a2bef5a3f2cc672de9ecd7feb0dc6961cd6f3
3
+ metadata.gz: c834ae661b8044e2c1f90fa98f6599556303e256dea24d843d37201df33d56b2
4
+ data.tar.gz: 82fd1eebbf608568f1dc7f961e51e89486644d272b32ed1b6f3d1688a93eb5bd
5
5
  SHA512:
6
- metadata.gz: ea6c1be5822ec94e583b27b6049e37d5de77186938dcb8296ef6bb3dcbf661d167e68240e39402d351fd96cd73c77121d2b1c10ed2de20c0a7e201e9becf5a6e
7
- data.tar.gz: 18ea2b987ed48e3a5eeb5a000b9cfb2df0b95da62e60af73f815e9ddbbb9580e6650c84044f8b4b8a4521bf6ddf84057fb4900bac939cc5df4cff4dc23fc97c3
6
+ metadata.gz: b8131e503c4dab60a65aa84ef0be46523806ad5e1dcb06fd8a496e268ec54635dc46b51aaa110f9811b01ad51adcc1f41c5a2f927f629ae5ea7998e08c2d41e9
7
+ data.tar.gz: e2ba0ba37a3fd99c1f303a51b6516769a3b6fd5c65311f2da1a1db194f9e2c62b412a8521208042909332afd3a24a929475aed2e7094550ce82a64c945cc3921
data/README.md CHANGED
@@ -10,50 +10,46 @@ Please do not submit the generated PKGBUILDs to the ArchLinux repository without
10
10
 
11
11
  ## How to use
12
12
 
13
- #### 1. Build a specific project:
13
+ #### 1. Create the dependency list
14
14
 
15
- `pkg-maven DATABASE.yaml PROJECT`
16
15
 
17
- You can try it:
16
+ Go to a maven project where the `pom.xml` file resides:
18
17
 
19
- `pkg-maven package.yaml jedis`
18
+ `pkg-maven-list-deps`
20
19
 
21
- #### 2. Build all the projects:
20
+ * It creates a `deps.yaml` file listing the dependencies, used later to create packages.
21
+ * The output of the execution lists which dependencies are already installed.
22
+ * It create a `classpath.txt` text file containing the classpath to use.
22
23
 
24
+ When all packages are created and installed you can use this classpath file like this:
23
25
 
24
- Create a package for each dependency in the database. It is quite simple for now and does not handle double entry or version conflicts.
26
+ ``` bash
27
+ CP=$(<classpath.txt)
28
+ java -cp $CP:target/* tech.lity.rea.app.Demo
29
+ ```
25
30
 
26
- `pkg-maven DATABASE.yaml all`
31
+ #### 2. Create packages from the dependency list
27
32
 
28
- You can try it:
33
+ Create a package for each dependency in the database. It is quite simple for now and does not handle double entry or version conflicts. You can create a new folder and try to build all the dependencies: 
29
34
 
30
- `pkg-maven package.yaml all`
35
+ ``` bash
36
+ mkdir dist ; cd dist
37
+ pkg-maven ../deps.yaml all
38
+ ```
31
39
 
32
- #### 3. Build a package by its name.
40
+ The output packages are collected to the `pkg` folder.
33
41
 
34
- You can also try it:
35
42
 
36
- `pkg-maven jedis redis.clients 2.9.0`
43
+ #### Alternative use: build a package by its name.
37
44
 
38
- This will create a package for **one jar only**. You can get get its dependencies by going in the folder and running the `pkg-maven-list-deps` script.
45
+ If you only miss few packages, or your project is small you can get packages one by one.
39
46
 
40
- ``` bash
41
- cd jedis
42
- pkg-maven-list-deps jedis.yaml ## here jedis.yaml is the output file name, the default is deps.yaml
43
- ```
44
- You can then use the `jedis.yaml` to create more packages !
47
+ `pkg-maven jedis redis.clients 2.9.0`
45
48
 
46
- If the generated name does not seem correct, you can add a `name` field:
49
+ This will create a package for **one jar only**. You can get get its dependencies by going in the folder and running the `pkg-maven-list-deps` script. For jedis, there are no external dependencies.
47
50
 
48
- ``` yaml
49
- jedis:
50
- groupid: redis.clients
51
- artifactid: jedis
52
- version: 2.9.0
53
- name: redis
54
- ```
51
+ The resulting package is:`pkg/java-jedis-2.9.0-1-any.pkg.tar.xz`.
55
52
 
56
- With this modification, the package name will be: `java-redis`.
57
53
 
58
54
  ## Options
59
55
 
@@ -69,20 +65,10 @@ Here is an example:
69
65
  `sudo pacman -U pkgs/java-jedis-2.9.0-1-any.pkg.tar.xz`
70
66
 
71
67
 
72
- ## Running an application
73
-
74
- The program `pkg-maven-list-deps` creates a `classpath.txt` that contains all the dependencies. You can use this way:
75
-
76
- ``` bash
77
- CP=$(<classpath.txt)
78
- java -cp $CP:target/* tech.lity.rea.nectar.camera.Test
79
- ```
80
-
81
-
82
68
  ### TODO:
83
69
 
84
70
  * ~Gemify this~.
85
71
  * ~Deploy Gem~.
86
- * Update README.
72
+ * ~Update README~ to improve.
87
73
  * More tests.
88
74
  * Better parsing.
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # coding: utf-8
2
3
  require 'yaml'
3
4
  require 'optparse'
4
5
  require 'MavenToPKGBUILD'
@@ -56,6 +57,15 @@ all_deps = {}
56
57
  all_deps_jar = ""
57
58
  prefix = "/usr/share/java/"
58
59
 
60
+
61
+ ## JOGL custom code
62
+ # add -native to jogl
63
+ #gl = ["jogl", "jogl-all", "newt", "nativewindow", "gluegen-rt"]
64
+ # /usr/share/java/jogl-all-with-deps/2.3.2/*
65
+
66
+ use_jogl = false
67
+
68
+
59
69
  lines.each do |l|
60
70
  groupid, artifactid, type, version = l.strip.split ":"
61
71
 
@@ -67,9 +77,22 @@ lines.each do |l|
67
77
  dep["artifactid"] = artifactid
68
78
  dep["version"] = version
69
79
 
70
- all_deps[artifactid] = dep
71
- end
80
+ ## TODO: use the gl variable instead ?
81
+ if artifactid.eql? "jogl-all" or artifactid.eql? "jogl-all-main" or artifactid.eql? "gluegen" or artifactid.eql? "gluegen-rt"
82
+ use_jogl = true
83
+
84
+ next
85
+ # dep["version"] = "2.3.2"
86
+ # dep_native = {}
87
+ # dep_native["groupid"] = groupid
88
+ # dep_native["artifactid"] = artifactid
89
+ # dep_native["version"] = "natives-linux-amd64"
90
+ # all_deps[artifactid+"-native"] = dep_native
91
+ end
92
+
93
+ all_deps[artifactid] = dep
72
94
 
95
+ end
73
96
 
74
97
  # TODO: Ignore it also before ?
75
98
  # Remove an element if there is one with the -platform also.
@@ -85,6 +108,7 @@ if without_platform.nil?
85
108
  exit
86
109
  end
87
110
 
111
+
88
112
  without_platform.each do |dep|
89
113
  v = create_pkg_version(dep["version"])
90
114
  n = dep["artifactid"]
@@ -100,6 +124,12 @@ without_platform.each do |dep|
100
124
  all_deps_jar = all_deps_jar + dep_file
101
125
  end
102
126
 
127
+ if use_jogl
128
+ dep_jogl = prefix + "jogl-all-with-deps/2.3.2/*"
129
+ all_deps_jar = all_deps_jar + ":" + dep_jogl
130
+ end
131
+
132
+
103
133
 
104
134
  File.open(output, 'w') {|f| f.write all_deps.to_yaml }
105
135
  File.open(classpath_name, 'w') {|f| f.write all_deps_jar }
@@ -1,3 +1,3 @@
1
1
  module MavenToPKGBUILD
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: MavenToPKGBUILD
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Laviole
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-12 00:00:00.000000000 Z
11
+ date: 2019-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler