> BTW ... a piece of software X is considered a derived work of some software Y, if X is dependent on Y for functioning and Y can't be replaced.
The notion of a work "derived" from another work is a notion from GPL, not from copyright law. The copyright notion most closely corresponding to what GPL seems to mean by derived work is "derivative work".
Whether or not X is a derivative work of Y does not depend on whether or not Y can be replaced. For instance, if I sit down right now and write a Firefox plug-in, whether or not it is a derivative work of Firefox or not is not affected in any way by whether or not there is some other browser that also accepts Firefox plug-ins. The status of my plug-in depends entirely on the relationship of my code to Firefox's code. If I have copied copyrighted elements (literally or via adaption, translation, etc) from Firefox, mine is a derivative work of Firefix. If I have not copied copyrighted elements from Firefox, my work is not a derived work of Firefox.
A license is free to define whatever terms it wants, and require licensees to obey them. Hence, if I were to use GPL code in my plug-in, I would have to obey GPL, including going along with whatever rules they have on works "derived from" other works, however they define that.
However, if the author of software X is careful to stick within the limits of what copyright allows--he does not copy any copyrightable elements from Y, then the license of Y and whatever terms it defines are irrelevant to Y, at least as far as direct infringement goes. That is, X is safe from Y suing alleging that X violates Y's copyright.
If the people who actually use X and Y together would be violating Y's license, then Y could try to sue X for "contributory infringement". That's when party Z infringes Y's copyright, and party X is held to be responsible for causing or aiding that infringement.
A very important and basic fact about contributory infringement: there can be no contributory infringement without direct infringement. This pretty much rules out contributory infringement when Y is under an open source license, as almost all of these licenses allow Z to do whatever he wants on his own machine, include make derivative works that combine Y with non-free code. No direct infringement by Z means no possibility of contributory infringement by X.
Putting it all together, here's what I would recommend for someone writing some piece of software, X, that is meant to work with some other piece of software, Y, as a plug-in, enhancement, patch, wrapper, etc. Assume Y is under an open source license.
1. Look at the license of Y. Are you willing to use the same license for X? If the answer is yes, use that license. Go code. Don't worry about possibly copying code from Y. (Assuming Y is using an open source license, of course).
2. If you aren't willing to use the same license as Y, are you willing to use a license that is compatible with it? For instance, Y uses GPL and you are willing to use BSD. If yes, use a compatible license. Go code. Do not copy code from Y (directly or via translation, adaptation, etc). Go ahead and look at Y if you need to in order to figure out something.
3. If you are not willing to use a license that is compatible with Y's license, be careful. Do not copy any code from Y, directly or via translation, etc. Avoid looking at Y's code at all. If you need to know something, such as the interface to a function of Y, get it from the documentation. If the documentation isn't adequate, get somebody who is NOT going to work on X's code or design to look at Y and write a spec. Code from that spec.
What you are trying to do in #3 is to limit yourself to doing things that do not require permission from Y's copyright owner. If you can hit that zone, you have no copyright worries, and you can write X and release under whatever license you want.